| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFIER_SETTINGS_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFIER_SETTINGS_VIEW_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFIER_SETTINGS_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFIER_SETTINGS_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 | 10 |
| 10 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "ui/message_center/message_center_export.h" | 13 #include "ui/message_center/message_center_export.h" |
| 14 #include "ui/message_center/notifier_settings.h" | 14 #include "ui/message_center/notifier_settings.h" |
| 15 #include "ui/message_center/views/message_bubble_base.h" | 15 #include "ui/message_center/views/message_bubble_base.h" |
| 16 #include "ui/views/controls/button/checkbox.h" | 16 #include "ui/views/controls/button/checkbox.h" |
| 17 #include "ui/views/controls/button/image_button.h" | 17 #include "ui/views/controls/button/image_button.h" |
| 18 #include "ui/views/controls/button/menu_button_listener.h" | 18 #include "ui/views/controls/button/menu_button_listener.h" |
| 19 #include "ui/views/controls/image_view.h" | 19 #include "ui/views/controls/image_view.h" |
| 20 #include "ui/views/view.h" | 20 #include "ui/views/view.h" |
| 21 | 21 |
| 22 namespace views { | 22 namespace views { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Overridden from views::ButtonListener: | 75 // Overridden from views::ButtonListener: |
| 76 void ButtonPressed(views::Button* button, const ui::Event& event) override; | 76 void ButtonPressed(views::Button* button, const ui::Event& event) override; |
| 77 void GetAccessibleState(ui::AXViewState* state) override; | 77 void GetAccessibleState(ui::AXViewState* state) override; |
| 78 | 78 |
| 79 bool ShouldHaveLearnMoreButton() const; | 79 bool ShouldHaveLearnMoreButton() const; |
| 80 // Helper function to reset the layout when the view has substantially | 80 // Helper function to reset the layout when the view has substantially |
| 81 // changed. | 81 // changed. |
| 82 void GridChanged(bool has_learn_more, bool has_icon_view); | 82 void GridChanged(bool has_learn_more, bool has_icon_view); |
| 83 | 83 |
| 84 NotifierSettingsProvider* provider_; // Weak. | 84 NotifierSettingsProvider* provider_; // Weak. |
| 85 const scoped_ptr<Notifier> notifier_; | 85 const std::unique_ptr<Notifier> notifier_; |
| 86 // |icon_view_| is owned by us because sometimes we don't leave it | 86 // |icon_view_| is owned by us because sometimes we don't leave it |
| 87 // in the view hierarchy. | 87 // in the view hierarchy. |
| 88 scoped_ptr<views::ImageView> icon_view_; | 88 std::unique_ptr<views::ImageView> icon_view_; |
| 89 views::Label* name_view_; | 89 views::Label* name_view_; |
| 90 views::Checkbox* checkbox_; | 90 views::Checkbox* checkbox_; |
| 91 views::ImageButton* learn_more_; | 91 views::ImageButton* learn_more_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(NotifierButton); | 93 DISALLOW_COPY_AND_ASSIGN(NotifierButton); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 // Given a new list of notifiers, updates the view to reflect it. | 96 // Given a new list of notifiers, updates the view to reflect it. |
| 97 void UpdateContentsView(const std::vector<Notifier*>& notifiers); | 97 void UpdateContentsView(const std::vector<Notifier*>& notifiers); |
| 98 | 98 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 110 void OnMenuButtonClicked(views::MenuButton* source, | 110 void OnMenuButtonClicked(views::MenuButton* source, |
| 111 const gfx::Point& point, | 111 const gfx::Point& point, |
| 112 const ui::Event* event) override; | 112 const ui::Event* event) override; |
| 113 | 113 |
| 114 views::ImageButton* title_arrow_; | 114 views::ImageButton* title_arrow_; |
| 115 views::Label* title_label_; | 115 views::Label* title_label_; |
| 116 views::MenuButton* notifier_group_selector_; | 116 views::MenuButton* notifier_group_selector_; |
| 117 views::ScrollView* scroller_; | 117 views::ScrollView* scroller_; |
| 118 NotifierSettingsProvider* provider_; | 118 NotifierSettingsProvider* provider_; |
| 119 std::set<NotifierButton*> buttons_; | 119 std::set<NotifierButton*> buttons_; |
| 120 scoped_ptr<NotifierGroupMenuModel> notifier_group_menu_model_; | 120 std::unique_ptr<NotifierGroupMenuModel> notifier_group_menu_model_; |
| 121 scoped_ptr<views::MenuRunner> notifier_group_menu_runner_; | 121 std::unique_ptr<views::MenuRunner> notifier_group_menu_runner_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(NotifierSettingsView); | 123 DISALLOW_COPY_AND_ASSIGN(NotifierSettingsView); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace message_center | 126 } // namespace message_center |
| 127 | 127 |
| 128 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFIER_SETTINGS_VIEW_H_ | 128 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFIER_SETTINGS_VIEW_H_ |
| OLD | NEW |