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_BUBBLE_BASE_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ |
| 6 #define UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/message_center/message_center.h" | |
| 9 #include "ui/message_center/message_center_export.h" | 10 #include "ui/message_center/message_center_export.h" |
| 10 #include "ui/message_center/notification_list.h" | 11 #include "ui/message_center/notification_list.h" |
|
Jun Mukai
2013/03/01 21:44:42
safe to remove this inclusion?
dharcourt
2013/03/02 02:08:02
Yes, thanks for catching this. Done.
| |
| 11 #include "ui/views/bubble/tray_bubble_view.h" | 12 #include "ui/views/bubble/tray_bubble_view.h" |
| 12 | 13 |
| 13 namespace message_center { | 14 namespace message_center { |
| 14 | 15 |
| 15 class MESSAGE_CENTER_EXPORT MessageBubbleBase { | 16 class MESSAGE_CENTER_EXPORT MessageBubbleBase { |
| 16 public: | 17 public: |
| 17 explicit MessageBubbleBase(NotificationList::Delegate* list_delegate); | 18 explicit MessageBubbleBase(MessageCenter* message_center); |
|
dharcourt
2013/03/01 10:17:31
Because NotificationList::Delegate doesn't provide
| |
| 18 | 19 |
| 19 virtual ~MessageBubbleBase(); | 20 virtual ~MessageBubbleBase(); |
| 20 | 21 |
| 21 // Gets called when the bubble view associated with this bubble is | 22 // Gets called when the bubble view associated with this bubble is |
| 22 // destroyed. Clears |bubble_view_| and calls OnBubbleViewDestroyed. | 23 // destroyed. Clears |bubble_view_| and calls OnBubbleViewDestroyed. |
| 23 void BubbleViewDestroyed(); | 24 void BubbleViewDestroyed(); |
| 24 | 25 |
| 25 // Sets/Gets the maximum height of the bubble view. Setting 0 changes the | 26 // Sets/Gets the maximum height of the bubble view. Setting 0 changes the |
| 26 // bubble to the default size. max_height() will return the default size | 27 // bubble to the default size. max_height() will return the default size |
| 27 // if SetMaxHeight() has not been called yet. | 28 // if SetMaxHeight() has not been called yet. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 54 | 55 |
| 55 views::TrayBubbleView* bubble_view() const { return bubble_view_; } | 56 views::TrayBubbleView* bubble_view() const { return bubble_view_; } |
| 56 | 57 |
| 57 static const SkColor kBackgroundColor; | 58 static const SkColor kBackgroundColor; |
| 58 static const SkColor kHeaderBackgroundColorLight; | 59 static const SkColor kHeaderBackgroundColorLight; |
| 59 static const SkColor kHeaderBackgroundColorDark; | 60 static const SkColor kHeaderBackgroundColorDark; |
| 60 | 61 |
| 61 protected: | 62 protected: |
| 62 views::TrayBubbleView::InitParams GetDefaultInitParams( | 63 views::TrayBubbleView::InitParams GetDefaultInitParams( |
| 63 views::TrayBubbleView::AnchorAlignment anchor_alignment); | 64 views::TrayBubbleView::AnchorAlignment anchor_alignment); |
| 64 NotificationList::Delegate* list_delegate() { return list_delegate_; } | 65 MessageCenter* message_center() { return message_center_; } |
| 65 void set_bubble_view(views::TrayBubbleView* bubble_view) { | 66 void set_bubble_view(views::TrayBubbleView* bubble_view) { |
| 66 bubble_view_ = bubble_view; | 67 bubble_view_ = bubble_view; |
| 67 } | 68 } |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 NotificationList::Delegate* list_delegate_; | 71 MessageCenter* message_center_; |
| 71 views::TrayBubbleView* bubble_view_; | 72 views::TrayBubbleView* bubble_view_; |
| 72 base::WeakPtrFactory<MessageBubbleBase> weak_ptr_factory_; | 73 base::WeakPtrFactory<MessageBubbleBase> weak_ptr_factory_; |
| 73 int max_height_; | 74 int max_height_; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(MessageBubbleBase); | 76 DISALLOW_COPY_AND_ASSIGN(MessageBubbleBase); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace message_center | 79 } // namespace message_center |
| 79 | 80 |
| 80 #endif // UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ | 81 #endif // UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ |
| OLD | NEW |