sub_feature_opt_in_view.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_SYSTEM_PHONEHUB_SUB_FEATURE_OPT_IN_VIEW_H_
  5. #define ASH_SYSTEM_PHONEHUB_SUB_FEATURE_OPT_IN_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/strings/grit/ash_strings.h"
  8. #include "ash/system/phonehub/phone_hub_view_ids.h"
  9. #include "base/scoped_observation.h"
  10. #include "phone_hub_view_ids.h"
  11. #include "ui/views/view.h"
  12. namespace views {
  13. class Label;
  14. class LabelButton;
  15. } // namespace views
  16. namespace ash {
  17. // An additional entry point shown on the Phone Hub bubble for the user to grant
  18. // access or opt out for phone hub sub feature.
  19. class ASH_EXPORT SubFeatureOptInView : public views::View {
  20. public:
  21. SubFeatureOptInView(const SubFeatureOptInView&) = delete;
  22. SubFeatureOptInView& operator=(const SubFeatureOptInView&) = delete;
  23. ~SubFeatureOptInView() override;
  24. protected:
  25. SubFeatureOptInView(PhoneHubViewID view_id,
  26. int description_string_id,
  27. int set_up_button_string_id);
  28. void RefreshDescription(int description_string_id);
  29. private:
  30. void InitLayout();
  31. virtual void SetUpButtonPressed() = 0;
  32. virtual void DismissButtonPressed() = 0;
  33. // View and string IDs
  34. PhoneHubViewID view_id_;
  35. int description_string_id_;
  36. int set_up_button_string_id_;
  37. // Main components of this view. Owned by view hierarchy.
  38. views::Label* text_label_ = nullptr;
  39. views::LabelButton* set_up_button_ = nullptr;
  40. views::LabelButton* dismiss_button_ = nullptr;
  41. };
  42. } // namespace ash
  43. #endif // ASH_SYSTEM_PHONEHUB_SUB_FEATURE_OPT_IN_VIEW_H_