| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NOTIFICATION_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ui/message_center/message_center_export.h" | 10 #include "ui/message_center/message_center_export.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // notification type. A notification is top level if it needs to be rendered | 39 // notification type. A notification is top level if it needs to be rendered |
| 40 // outside the browser window. No custom shadows are created for top level | 40 // outside the browser window. No custom shadows are created for top level |
| 41 // notifications on Linux with Aura. | 41 // notifications on Linux with Aura. |
| 42 // |controller| may be NULL, but has to be set before the view is shown. | 42 // |controller| may be NULL, but has to be set before the view is shown. |
| 43 static NotificationView* Create(MessageCenterController* controller, | 43 static NotificationView* Create(MessageCenterController* controller, |
| 44 const Notification& notification, | 44 const Notification& notification, |
| 45 bool top_level); | 45 bool top_level); |
| 46 virtual ~NotificationView(); | 46 virtual ~NotificationView(); |
| 47 | 47 |
| 48 // Overridden from views::View: | 48 // Overridden from views::View: |
| 49 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 49 virtual gfx::Size GetPreferredSize() const override; |
| 50 virtual int GetHeightForWidth(int width) const OVERRIDE; | 50 virtual int GetHeightForWidth(int width) const override; |
| 51 virtual void Layout() OVERRIDE; | 51 virtual void Layout() override; |
| 52 virtual void OnFocus() OVERRIDE; | 52 virtual void OnFocus() override; |
| 53 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; | 53 virtual void ScrollRectToVisible(const gfx::Rect& rect) override; |
| 54 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 54 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; |
| 55 | 55 |
| 56 // Overridden from MessageView: | 56 // Overridden from MessageView: |
| 57 virtual void UpdateWithNotification( | 57 virtual void UpdateWithNotification( |
| 58 const Notification& notification) OVERRIDE; | 58 const Notification& notification) override; |
| 59 virtual void ButtonPressed(views::Button* sender, | 59 virtual void ButtonPressed(views::Button* sender, |
| 60 const ui::Event& event) OVERRIDE; | 60 const ui::Event& event) override; |
| 61 | 61 |
| 62 // Overridden from MessageViewController: | 62 // Overridden from MessageViewController: |
| 63 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; | 63 virtual void ClickOnNotification(const std::string& notification_id) override; |
| 64 virtual void RemoveNotification(const std::string& notification_id, | 64 virtual void RemoveNotification(const std::string& notification_id, |
| 65 bool by_user) OVERRIDE; | 65 bool by_user) override; |
| 66 | 66 |
| 67 void set_controller(MessageCenterController* controller) { | 67 void set_controller(MessageCenterController* controller) { |
| 68 controller_ = controller; | 68 controller_ = controller; |
| 69 } | 69 } |
| 70 | 70 |
| 71 protected: | 71 protected: |
| 72 NotificationView(MessageCenterController* controller, | 72 NotificationView(MessageCenterController* controller, |
| 73 const Notification& notification); | 73 const Notification& notification); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest); | 76 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest); |
| 77 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, TestLineLimits); | 77 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, TestLineLimits); |
| 78 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonsStateTest); | 78 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonsStateTest); |
| 79 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonCountTest); | 79 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonCountTest); |
| 80 | 80 |
| 81 friend class NotificationViewTest; | 81 friend class NotificationViewTest; |
| 82 | 82 |
| 83 // views::ViewTargeterDelegate: | 83 // views::ViewTargeterDelegate: |
| 84 virtual views::View* TargetForRect(views::View* root, | 84 virtual views::View* TargetForRect(views::View* root, |
| 85 const gfx::Rect& rect) OVERRIDE; | 85 const gfx::Rect& rect) override; |
| 86 | 86 |
| 87 void CreateOrUpdateViews(const Notification& notification); | 87 void CreateOrUpdateViews(const Notification& notification); |
| 88 void SetAccessibleName(const Notification& notification); | 88 void SetAccessibleName(const Notification& notification); |
| 89 | 89 |
| 90 void CreateOrUpdateTitleView(const Notification& notification); | 90 void CreateOrUpdateTitleView(const Notification& notification); |
| 91 void CreateOrUpdateMessageView(const Notification& notification); | 91 void CreateOrUpdateMessageView(const Notification& notification); |
| 92 void CreateOrUpdateContextMessageView(const Notification& notification); | 92 void CreateOrUpdateContextMessageView(const Notification& notification); |
| 93 void CreateOrUpdateProgressBarView(const Notification& notification); | 93 void CreateOrUpdateProgressBarView(const Notification& notification); |
| 94 void CreateOrUpdateListItemViews(const Notification& notification); | 94 void CreateOrUpdateListItemViews(const Notification& notification); |
| 95 void CreateOrUpdateIconView(const Notification& notification); | 95 void CreateOrUpdateIconView(const Notification& notification); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 116 views::ProgressBar* progress_bar_view_; | 116 views::ProgressBar* progress_bar_view_; |
| 117 std::vector<NotificationButton*> action_buttons_; | 117 std::vector<NotificationButton*> action_buttons_; |
| 118 std::vector<views::View*> separators_; | 118 std::vector<views::View*> separators_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(NotificationView); | 120 DISALLOW_COPY_AND_ASSIGN(NotificationView); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace message_center | 123 } // namespace message_center |
| 124 | 124 |
| 125 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ | 125 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
| OLD | NEW |