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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 // Overridden from views::View: | 45 // Overridden from views::View: |
46 virtual gfx::Size GetPreferredSize() OVERRIDE; | 46 virtual gfx::Size GetPreferredSize() OVERRIDE; |
47 virtual int GetHeightForWidth(int width) OVERRIDE; | 47 virtual int GetHeightForWidth(int width) OVERRIDE; |
48 virtual void Layout() OVERRIDE; | 48 virtual void Layout() OVERRIDE; |
49 virtual void OnFocus() OVERRIDE; | 49 virtual void OnFocus() OVERRIDE; |
50 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; | 50 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; |
51 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; | 51 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; |
52 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 52 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
53 | 53 |
54 // Overridden from MessageView: | 54 // Overridden from MessageView: |
55 virtual void UpdateWithNotification( | |
56 const Notification& notification) OVERRIDE; | |
55 virtual void ButtonPressed(views::Button* sender, | 57 virtual void ButtonPressed(views::Button* sender, |
56 const ui::Event& event) OVERRIDE; | 58 const ui::Event& event) OVERRIDE; |
57 | 59 |
58 // Overridden from MessageViewController: | 60 // Overridden from MessageViewController: |
59 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; | 61 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; |
60 virtual void RemoveNotification(const std::string& notification_id, | 62 virtual void RemoveNotification(const std::string& notification_id, |
61 bool by_user) OVERRIDE; | 63 bool by_user) OVERRIDE; |
62 | 64 |
63 void set_controller(MessageCenterController* controller) { | 65 void set_controller(MessageCenterController* controller) { |
64 controller_ = controller; | 66 controller_ = controller; |
65 } | 67 } |
66 | 68 |
67 protected: | 69 protected: |
68 NotificationView(MessageCenterController* controller, | 70 NotificationView(MessageCenterController* controller, |
69 const Notification& notification); | 71 const Notification& notification); |
70 | 72 |
71 private: | 73 private: |
74 void CreateViews(const Notification& notification); | |
Jun Mukai
2014/05/07 23:15:11
nit: this doesn't actually create views right? It
| |
75 void SetAccessibleName(const Notification& notification); | |
76 | |
77 void CreateTitleView(const Notification& notification); | |
78 void CreateMessageView(const Notification& notification); | |
79 void CreateContextMessageView(const Notification& notification); | |
80 void CreateProgressBarView(const Notification& notification); | |
81 void CreateListItemViews(const Notification& notification); | |
82 void CreateIconView(const Notification& notification); | |
83 void CreateImageView(const Notification& notification); | |
84 void CreateActionButtonViews(const Notification& notification); | |
85 | |
72 int GetMessageLineLimit(int width); | 86 int GetMessageLineLimit(int width); |
73 int GetMessageHeight(int width, int limit); | 87 int GetMessageHeight(int width, int limit); |
74 | 88 |
75 MessageCenterController* controller_; // Weak, lives longer then views. | 89 MessageCenterController* controller_; // Weak, lives longer then views. |
76 | 90 |
77 // Describes whether the view should display a hand pointer or not. | 91 // Describes whether the view should display a hand pointer or not. |
78 bool clickable_; | 92 bool clickable_; |
79 | 93 |
80 // Weak references to NotificationView descendants owned by their parents. | 94 // Weak references to NotificationView descendants owned by their parents. |
81 views::View* top_view_; | 95 views::View* top_view_; |
82 BoundedLabel* title_view_; | 96 BoundedLabel* title_view_; |
83 BoundedLabel* message_view_; | 97 BoundedLabel* message_view_; |
84 BoundedLabel* context_message_view_; | 98 BoundedLabel* context_message_view_; |
85 std::vector<views::View*> item_views_; | 99 std::vector<views::View*> item_views_; |
86 views::View* icon_view_; | 100 views::View* icon_view_; |
87 views::View* bottom_view_; | 101 views::View* bottom_view_; |
88 views::View* image_view_; | 102 views::View* image_view_; |
89 views::ProgressBar* progress_bar_view_; | 103 views::ProgressBar* progress_bar_view_; |
90 std::vector<views::View*> action_buttons_; | 104 std::vector<views::View*> action_buttons_; |
105 std::vector<views::View*> separators_; | |
91 | 106 |
92 DISALLOW_COPY_AND_ASSIGN(NotificationView); | 107 DISALLOW_COPY_AND_ASSIGN(NotificationView); |
93 }; | 108 }; |
94 | 109 |
95 } // namespace message_center | 110 } // namespace message_center |
96 | 111 |
97 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ | 112 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
OLD | NEW |