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 24 matching lines...) Expand all Loading... |
35 // notification type. A notification is top level if it needs to be rendered | 35 // notification type. A notification is top level if it needs to be rendered |
36 // outside the browser window. No custom shadows are created for top level | 36 // outside the browser window. No custom shadows are created for top level |
37 // notifications on Linux with Aura. | 37 // notifications on Linux with Aura. |
38 // |controller| may be NULL, but has to be set before the view is shown. | 38 // |controller| may be NULL, but has to be set before the view is shown. |
39 static NotificationView* Create(MessageCenterController* controller, | 39 static NotificationView* Create(MessageCenterController* controller, |
40 const Notification& notification, | 40 const Notification& notification, |
41 bool top_level); | 41 bool top_level); |
42 virtual ~NotificationView(); | 42 virtual ~NotificationView(); |
43 | 43 |
44 // Overridden from views::View: | 44 // Overridden from views::View: |
45 virtual gfx::Size GetPreferredSize() OVERRIDE; | 45 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
46 virtual int GetHeightForWidth(int width) OVERRIDE; | 46 virtual int GetHeightForWidth(int width) const OVERRIDE; |
47 virtual void Layout() OVERRIDE; | 47 virtual void Layout() OVERRIDE; |
48 virtual void OnFocus() OVERRIDE; | 48 virtual void OnFocus() OVERRIDE; |
49 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; | 49 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; |
50 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; | 50 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; |
51 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 51 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
52 | 52 |
53 // Overridden from MessageView: | 53 // Overridden from MessageView: |
54 virtual void UpdateWithNotification( | 54 virtual void UpdateWithNotification( |
55 const Notification& notification) OVERRIDE; | 55 const Notification& notification) OVERRIDE; |
56 virtual void ButtonPressed(views::Button* sender, | 56 virtual void ButtonPressed(views::Button* sender, |
(...skipping 21 matching lines...) Expand all Loading... |
78 | 78 |
79 void CreateOrUpdateTitleView(const Notification& notification); | 79 void CreateOrUpdateTitleView(const Notification& notification); |
80 void CreateOrUpdateMessageView(const Notification& notification); | 80 void CreateOrUpdateMessageView(const Notification& notification); |
81 void CreateOrUpdateContextMessageView(const Notification& notification); | 81 void CreateOrUpdateContextMessageView(const Notification& notification); |
82 void CreateOrUpdateProgressBarView(const Notification& notification); | 82 void CreateOrUpdateProgressBarView(const Notification& notification); |
83 void CreateOrUpdateListItemViews(const Notification& notification); | 83 void CreateOrUpdateListItemViews(const Notification& notification); |
84 void CreateOrUpdateIconView(const Notification& notification); | 84 void CreateOrUpdateIconView(const Notification& notification); |
85 void CreateOrUpdateImageView(const Notification& notification); | 85 void CreateOrUpdateImageView(const Notification& notification); |
86 void CreateOrUpdateActionButtonViews(const Notification& notification); | 86 void CreateOrUpdateActionButtonViews(const Notification& notification); |
87 | 87 |
88 int GetMessageLineLimit(int title_lines, int width); | 88 int GetMessageLineLimit(int title_lines, int width) const; |
89 int GetMessageHeight(int width, int limit); | 89 int GetMessageHeight(int width, int limit) const; |
90 | 90 |
91 MessageCenterController* controller_; // Weak, lives longer then views. | 91 MessageCenterController* controller_; // Weak, lives longer then views. |
92 | 92 |
93 // Describes whether the view should display a hand pointer or not. | 93 // Describes whether the view should display a hand pointer or not. |
94 bool clickable_; | 94 bool clickable_; |
95 | 95 |
96 // Weak references to NotificationView descendants owned by their parents. | 96 // Weak references to NotificationView descendants owned by their parents. |
97 views::View* top_view_; | 97 views::View* top_view_; |
98 BoundedLabel* title_view_; | 98 BoundedLabel* title_view_; |
99 BoundedLabel* message_view_; | 99 BoundedLabel* message_view_; |
100 BoundedLabel* context_message_view_; | 100 BoundedLabel* context_message_view_; |
101 std::vector<views::View*> item_views_; | 101 std::vector<views::View*> item_views_; |
102 views::View* icon_view_; | 102 views::View* icon_view_; |
103 views::View* bottom_view_; | 103 views::View* bottom_view_; |
104 views::View* image_view_; | 104 views::View* image_view_; |
105 views::ProgressBar* progress_bar_view_; | 105 views::ProgressBar* progress_bar_view_; |
106 std::vector<views::View*> action_buttons_; | 106 std::vector<views::View*> action_buttons_; |
107 std::vector<views::View*> separators_; | 107 std::vector<views::View*> separators_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(NotificationView); | 109 DISALLOW_COPY_AND_ASSIGN(NotificationView); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace message_center | 112 } // namespace message_center |
113 | 113 |
114 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ | 114 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
OLD | NEW |