| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 virtual void Layout() OVERRIDE; | 46 virtual void Layout() OVERRIDE; |
| 47 virtual void OnFocus() OVERRIDE; | 47 virtual void OnFocus() OVERRIDE; |
| 48 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; | 48 virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE; |
| 49 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; | 49 virtual views::View* GetEventHandlerForRect(const gfx::Rect& rect) OVERRIDE; |
| 50 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 50 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
| 51 | 51 |
| 52 // Overridden from MessageView: | 52 // Overridden from MessageView: |
| 53 virtual void ButtonPressed(views::Button* sender, | 53 virtual void ButtonPressed(views::Button* sender, |
| 54 const ui::Event& event) OVERRIDE; | 54 const ui::Event& event) OVERRIDE; |
| 55 | 55 |
| 56 std::string notification_id() { return notification_id_; } |
| 57 |
| 56 protected: | 58 protected: |
| 57 NotificationView(const Notification& notification, | 59 NotificationView(const Notification& notification, |
| 58 MessageCenter* message_center, | 60 MessageCenter* message_center, |
| 59 MessageCenterTray* tray, | 61 MessageCenterTray* tray, |
| 60 bool expanded); | 62 bool expanded); |
| 61 | 63 |
| 64 // Overrides from base class MessageView: |
| 65 virtual MessageViewTypes GetType() OVERRIDE; |
| 66 virtual void ClickOnNotification() OVERRIDE; |
| 67 virtual void RemoveNotification(bool by_user) OVERRIDE; |
| 68 virtual void DisableNotificationsFromThisSource() OVERRIDE; |
| 69 virtual void ShowNotifierSettingsBubble() OVERRIDE; |
| 70 |
| 62 private: | 71 private: |
| 63 bool IsExpansionNeeded(int width); | 72 bool IsExpansionNeeded(int width); |
| 64 bool IsMessageExpansionNeeded(int width); | 73 bool IsMessageExpansionNeeded(int width); |
| 65 int GetMessageLineLimit(int width); | 74 int GetMessageLineLimit(int width); |
| 66 int GetMessageLines(int width, int limit); | 75 int GetMessageLines(int width, int limit); |
| 67 int GetMessageHeight(int width, int limit); | 76 int GetMessageHeight(int width, int limit); |
| 68 | 77 |
| 78 MessageCenter* message_center_; // Weak. |
| 79 MessageCenterTray* tray_; // Weak. |
| 80 std::string notification_id_; |
| 81 message_center::NotifierId notifier_id_; |
| 82 |
| 69 // Describes whether the view should display a hand pointer or not. | 83 // Describes whether the view should display a hand pointer or not. |
| 70 bool clickable_; | 84 bool clickable_; |
| 71 bool is_expanded_; | 85 bool is_expanded_; |
| 72 | 86 |
| 73 // Weak references to NotificationView descendants owned by their parents. | 87 // Weak references to NotificationView descendants owned by their parents. |
| 74 views::View* background_view_; | 88 views::View* background_view_; |
| 75 views::View* top_view_; | 89 views::View* top_view_; |
| 76 BoundedLabel* title_view_; | 90 BoundedLabel* title_view_; |
| 77 BoundedLabel* message_view_; | 91 BoundedLabel* message_view_; |
| 78 BoundedLabel* context_message_view_; | 92 BoundedLabel* context_message_view_; |
| 79 std::vector<views::View*> item_views_; | 93 std::vector<views::View*> item_views_; |
| 80 views::View* icon_view_; | 94 views::View* icon_view_; |
| 81 views::View* bottom_view_; | 95 views::View* bottom_view_; |
| 82 views::View* image_view_; | 96 views::View* image_view_; |
| 83 views::ProgressBar* progress_bar_view_; | 97 views::ProgressBar* progress_bar_view_; |
| 84 std::vector<views::View*> action_buttons_; | 98 std::vector<views::View*> action_buttons_; |
| 85 PaddedButton* expand_button_; | 99 PaddedButton* expand_button_; |
| 86 | 100 |
| 87 DISALLOW_COPY_AND_ASSIGN(NotificationView); | 101 DISALLOW_COPY_AND_ASSIGN(NotificationView); |
| 88 }; | 102 }; |
| 89 | 103 |
| 90 } // namespace message_center | 104 } // namespace message_center |
| 91 | 105 |
| 92 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ | 106 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_ |
| OLD | NEW |