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_MESSAGE_CENTER_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
7 | 7 |
8 | 8 |
9 #include "ui/gfx/animation/animation_delegate.h" | 9 #include "ui/gfx/animation/animation_delegate.h" |
10 #include "ui/message_center/message_center_export.h" | 10 #include "ui/message_center/message_center_export.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 public MessageCenterObserver, | 43 public MessageCenterObserver, |
44 public MessageCenterController, | 44 public MessageCenterController, |
45 public gfx::AnimationDelegate { | 45 public gfx::AnimationDelegate { |
46 public: | 46 public: |
47 MessageCenterView(MessageCenter* message_center, | 47 MessageCenterView(MessageCenter* message_center, |
48 MessageCenterTray* tray, | 48 MessageCenterTray* tray, |
49 int max_height, | 49 int max_height, |
50 bool initially_settings_visible, | 50 bool initially_settings_visible, |
51 bool top_down, | 51 bool top_down, |
52 const base::string16& title); | 52 const base::string16& title); |
53 virtual ~MessageCenterView(); | 53 ~MessageCenterView() override; |
54 | 54 |
55 void SetNotifications(const NotificationList::Notifications& notifications); | 55 void SetNotifications(const NotificationList::Notifications& notifications); |
56 | 56 |
57 void ClearAllNotifications(); | 57 void ClearAllNotifications(); |
58 void OnAllNotificationsCleared(); | 58 void OnAllNotificationsCleared(); |
59 | 59 |
60 size_t NumMessageViewsForTest() const; | 60 size_t NumMessageViewsForTest() const; |
61 | 61 |
62 void SetSettingsVisible(bool visible); | 62 void SetSettingsVisible(bool visible); |
63 void OnSettingsChanged(); | 63 void OnSettingsChanged(); |
64 bool settings_visible() const { return settings_visible_; } | 64 bool settings_visible() const { return settings_visible_; } |
65 MessageCenterTray* tray() { return tray_; } | 65 MessageCenterTray* tray() { return tray_; } |
66 | 66 |
67 void SetIsClosing(bool is_closing); | 67 void SetIsClosing(bool is_closing); |
68 | 68 |
69 protected: | 69 protected: |
70 // Overridden from views::View: | 70 // Overridden from views::View: |
71 virtual void Layout() override; | 71 void Layout() override; |
72 virtual gfx::Size GetPreferredSize() const override; | 72 gfx::Size GetPreferredSize() const override; |
73 virtual int GetHeightForWidth(int width) const override; | 73 int GetHeightForWidth(int width) const override; |
74 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override; | 74 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; |
75 virtual void OnMouseExited(const ui::MouseEvent& event) override; | 75 void OnMouseExited(const ui::MouseEvent& event) override; |
76 | 76 |
77 // Overridden from MessageCenterObserver: | 77 // Overridden from MessageCenterObserver: |
78 virtual void OnNotificationAdded(const std::string& id) override; | 78 void OnNotificationAdded(const std::string& id) override; |
79 virtual void OnNotificationRemoved(const std::string& id, | 79 void OnNotificationRemoved(const std::string& id, bool by_user) override; |
80 bool by_user) override; | 80 void OnNotificationUpdated(const std::string& id) override; |
81 virtual void OnNotificationUpdated(const std::string& id) override; | |
82 | 81 |
83 // Overridden from MessageCenterController: | 82 // Overridden from MessageCenterController: |
84 virtual void ClickOnNotification(const std::string& notification_id) override; | 83 void ClickOnNotification(const std::string& notification_id) override; |
85 virtual void RemoveNotification(const std::string& notification_id, | 84 void RemoveNotification(const std::string& notification_id, |
86 bool by_user) override; | 85 bool by_user) override; |
87 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( | 86 scoped_ptr<ui::MenuModel> CreateMenuModel( |
88 const NotifierId& notifier_id, | 87 const NotifierId& notifier_id, |
89 const base::string16& display_source) override; | 88 const base::string16& display_source) override; |
90 virtual bool HasClickedListener(const std::string& notification_id) override; | 89 bool HasClickedListener(const std::string& notification_id) override; |
91 virtual void ClickOnNotificationButton(const std::string& notification_id, | 90 void ClickOnNotificationButton(const std::string& notification_id, |
92 int button_index) override; | 91 int button_index) override; |
93 | 92 |
94 // Overridden from gfx::AnimationDelegate: | 93 // Overridden from gfx::AnimationDelegate: |
95 virtual void AnimationEnded(const gfx::Animation* animation) override; | 94 void AnimationEnded(const gfx::Animation* animation) override; |
96 virtual void AnimationProgressed(const gfx::Animation* animation) override; | 95 void AnimationProgressed(const gfx::Animation* animation) override; |
97 virtual void AnimationCanceled(const gfx::Animation* animation) override; | 96 void AnimationCanceled(const gfx::Animation* animation) override; |
98 | 97 |
99 private: | 98 private: |
100 friend class MessageCenterViewTest; | 99 friend class MessageCenterViewTest; |
101 | 100 |
102 void AddNotificationAt(const Notification& notification, int index); | 101 void AddNotificationAt(const Notification& notification, int index); |
103 void NotificationsChanged(); | 102 void NotificationsChanged(); |
104 void SetNotificationViewForTest(MessageView* view); | 103 void SetNotificationViewForTest(MessageView* view); |
105 | 104 |
106 MessageCenter* message_center_; // Weak reference. | 105 MessageCenter* message_center_; // Weak reference. |
107 MessageCenterTray* tray_; // Weak reference. | 106 MessageCenterTray* tray_; // Weak reference. |
(...skipping 30 matching lines...) Expand all Loading... |
138 bool is_closing_; | 137 bool is_closing_; |
139 | 138 |
140 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; | 139 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; |
141 | 140 |
142 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); | 141 DISALLOW_COPY_AND_ASSIGN(MessageCenterView); |
143 }; | 142 }; |
144 | 143 |
145 } // namespace message_center | 144 } // namespace message_center |
146 | 145 |
147 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ | 146 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_VIEW_H_ |
OLD | NEW |