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" |
11 #include "ui/message_center/views/message_view.h" | 11 #include "ui/message_center/views/message_view.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class ProgressBar; | 14 class ProgressBar; |
15 } | 15 } |
16 | 16 |
17 namespace message_center { | 17 namespace message_center { |
18 | 18 |
19 class BoundedLabel; | 19 class BoundedLabel; |
20 class MessageCenter; | 20 class MessageCenter; |
21 class MessageCenterController; | 21 class MessageCenterController; |
| 22 class NotificationButton; |
22 class NotificationView; | 23 class NotificationView; |
23 class PaddedButton; | 24 class PaddedButton; |
24 | 25 |
25 // View that displays all current types of notification (web, basic, image, and | 26 // View that displays all current types of notification (web, basic, image, and |
26 // list). Future notification types may be handled by other classes, in which | 27 // list). Future notification types may be handled by other classes, in which |
27 // case instances of those classes would be returned by the Create() factory | 28 // case instances of those classes would be returned by the Create() factory |
28 // method below. | 29 // method below. |
29 class MESSAGE_CENTER_EXPORT NotificationView : public MessageView, | 30 class MESSAGE_CENTER_EXPORT NotificationView : public MessageView, |
30 public MessageViewController { | 31 public MessageViewController { |
31 public: | 32 public: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 controller_ = controller; | 66 controller_ = controller; |
66 } | 67 } |
67 | 68 |
68 protected: | 69 protected: |
69 NotificationView(MessageCenterController* controller, | 70 NotificationView(MessageCenterController* controller, |
70 const Notification& notification); | 71 const Notification& notification); |
71 | 72 |
72 private: | 73 private: |
73 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest); | 74 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest); |
74 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, TestLineLimits); | 75 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, TestLineLimits); |
| 76 FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, UpdateButtonsStateTest); |
75 | 77 |
76 void CreateOrUpdateViews(const Notification& notification); | 78 void CreateOrUpdateViews(const Notification& notification); |
77 void SetAccessibleName(const Notification& notification); | 79 void SetAccessibleName(const Notification& notification); |
78 | 80 |
79 void CreateOrUpdateTitleView(const Notification& notification); | 81 void CreateOrUpdateTitleView(const Notification& notification); |
80 void CreateOrUpdateMessageView(const Notification& notification); | 82 void CreateOrUpdateMessageView(const Notification& notification); |
81 void CreateOrUpdateContextMessageView(const Notification& notification); | 83 void CreateOrUpdateContextMessageView(const Notification& notification); |
82 void CreateOrUpdateProgressBarView(const Notification& notification); | 84 void CreateOrUpdateProgressBarView(const Notification& notification); |
83 void CreateOrUpdateListItemViews(const Notification& notification); | 85 void CreateOrUpdateListItemViews(const Notification& notification); |
84 void CreateOrUpdateIconView(const Notification& notification); | 86 void CreateOrUpdateIconView(const Notification& notification); |
(...skipping 11 matching lines...) Expand all Loading... |
96 // Weak references to NotificationView descendants owned by their parents. | 98 // Weak references to NotificationView descendants owned by their parents. |
97 views::View* top_view_; | 99 views::View* top_view_; |
98 BoundedLabel* title_view_; | 100 BoundedLabel* title_view_; |
99 BoundedLabel* message_view_; | 101 BoundedLabel* message_view_; |
100 BoundedLabel* context_message_view_; | 102 BoundedLabel* context_message_view_; |
101 std::vector<views::View*> item_views_; | 103 std::vector<views::View*> item_views_; |
102 views::View* icon_view_; | 104 views::View* icon_view_; |
103 views::View* bottom_view_; | 105 views::View* bottom_view_; |
104 views::View* image_view_; | 106 views::View* image_view_; |
105 views::ProgressBar* progress_bar_view_; | 107 views::ProgressBar* progress_bar_view_; |
106 std::vector<views::View*> action_buttons_; | 108 std::vector<NotificationButton*> action_buttons_; |
107 std::vector<views::View*> separators_; | 109 std::vector<views::View*> separators_; |
108 | 110 |
109 DISALLOW_COPY_AND_ASSIGN(NotificationView); | 111 DISALLOW_COPY_AND_ASSIGN(NotificationView); |
110 }; | 112 }; |
111 | 113 |
112 } // namespace message_center | 114 } // namespace message_center |
113 | 115 |
114 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ | 116 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
OLD | NEW |