Chromium Code Reviews| 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_MESSAGE_CENTER_BUBBLE_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_BUBBLE_H_ |
| 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_BUBBLE_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_BUBBLE_H_ |
| 7 | 7 |
| 8 #include "ui/message_center/message_bubble_base.h" | 8 #include "ui/message_center/message_bubble_base.h" |
| 9 #include "ui/message_center/message_center_export.h" | 9 #include "ui/message_center/message_center_export.h" |
| 10 #include "ui/message_center/notification_list.h" | 10 #include "ui/message_center/notification_list.h" |
| 11 | 11 |
| 12 namespace message_center { | 12 namespace message_center { |
| 13 | 13 |
| 14 class MessageCenterContentsView; | 14 class MessageCenterView; |
| 15 | 15 |
| 16 // Bubble for message center. | 16 // Bubble for message center. |
| 17 class MESSAGE_CENTER_EXPORT MessageCenterBubble : public MessageBubbleBase { | 17 class MESSAGE_CENTER_EXPORT MessageCenterBubble |
| 18 : public MessageBubbleBase, | |
| 19 public NotificationList::Delegate { | |
|
dharcourt
2013/03/01 10:17:31
MessageCenterBubble now implements NotificationLis
Jun Mukai
2013/03/01 21:44:42
Inheriting Delegate is not a good idea here. Usual
dharcourt
2013/03/02 02:08:02
Sounds good. I've implemented this by taking the d
| |
| 18 public: | 20 public: |
| 19 explicit MessageCenterBubble(NotificationList::Delegate* delegate); | 21 explicit MessageCenterBubble(MessageCenter* message_center); |
| 20 | 22 |
| 21 virtual ~MessageCenterBubble(); | 23 virtual ~MessageCenterBubble(); |
| 22 | 24 |
| 23 // Overridden from MessageBubbleBase. | 25 // Overridden from MessageBubbleBase: |
| 24 virtual views::TrayBubbleView::InitParams GetInitParams( | 26 virtual views::TrayBubbleView::InitParams GetInitParams( |
| 25 views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE; | 27 views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE; |
| 26 virtual void InitializeContents(views::TrayBubbleView* bubble_view) OVERRIDE; | 28 virtual void InitializeContents(views::TrayBubbleView* bubble_view) OVERRIDE; |
| 27 virtual void OnBubbleViewDestroyed() OVERRIDE; | 29 virtual void OnBubbleViewDestroyed() OVERRIDE; |
| 28 virtual void UpdateBubbleView() OVERRIDE; | 30 virtual void UpdateBubbleView() OVERRIDE; |
| 29 virtual void OnMouseEnteredView() OVERRIDE; | 31 virtual void OnMouseEnteredView() OVERRIDE; |
| 30 virtual void OnMouseExitedView() OVERRIDE; | 32 virtual void OnMouseExitedView() OVERRIDE; |
| 31 | 33 |
| 34 // Overridden from NotificationList::Delegate: | |
| 35 virtual void SendRemoveNotification(const std::string& id, | |
| 36 bool by_user) OVERRIDE; | |
| 37 virtual void SendRemoveAllNotifications(bool by_user) OVERRIDE; | |
| 38 virtual void DisableNotificationByExtension(const std::string& id) OVERRIDE; | |
| 39 virtual void DisableNotificationByUrl(const std::string& id) OVERRIDE; | |
| 40 virtual void ShowNotificationSettings(const std::string& id) OVERRIDE; | |
| 41 virtual void ShowNotificationSettingsDialog(gfx::NativeView context) OVERRIDE; | |
| 42 virtual void OnNotificationClicked(const std::string& id) OVERRIDE; | |
| 43 virtual void OnButtonClicked(const std::string& id, | |
| 44 int button_index) OVERRIDE; | |
| 45 virtual void OnExpand(const std::string& id) OVERRIDE; | |
| 46 virtual void OnQuietModeChanged(bool quiet_mode) OVERRIDE; | |
| 47 | |
| 32 size_t NumMessageViewsForTest() const; | 48 size_t NumMessageViewsForTest() const; |
| 33 | 49 |
| 34 private: | 50 private: |
| 35 MessageCenterContentsView* contents_view_; | 51 MessageCenterView* contents_view_; |
| 36 | 52 |
| 37 // The maximum height | 53 // The maximum height |
| 38 int max_height_; | 54 int max_height_; |
| 39 | 55 |
| 40 DISALLOW_COPY_AND_ASSIGN(MessageCenterBubble); | 56 DISALLOW_COPY_AND_ASSIGN(MessageCenterBubble); |
| 41 }; | 57 }; |
| 42 | 58 |
| 43 } // namespace message_center | 59 } // namespace message_center |
| 44 | 60 |
| 45 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_BUBBLE_H_ | 61 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_BUBBLE_H_ |
| OLD | NEW |