| 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/views/bubble/tray_bubble_view.h" | 11 #include "ui/views/bubble/tray_bubble_view.h" |
| 12 | 12 |
| 13 namespace message_center { | 13 namespace message_center { |
| 14 | 14 |
| 15 class MESSAGE_CENTER_EXPORT MessageBubbleBase { | 15 class MESSAGE_CENTER_EXPORT MessageBubbleBase { |
| 16 public: | 16 public: |
| 17 explicit MessageBubbleBase(NotificationList::Delegate* list_delegate); | 17 explicit MessageBubbleBase(MessageCenter* message_center); |
| 18 | 18 |
| 19 virtual ~MessageBubbleBase(); | 19 virtual ~MessageBubbleBase(); |
| 20 | 20 |
| 21 // Gets called when the bubble view associated with this bubble is | 21 // Gets called when the bubble view associated with this bubble is |
| 22 // destroyed. Clears |bubble_view_| and calls OnBubbleViewDestroyed. | 22 // destroyed. Clears |bubble_view_| and calls OnBubbleViewDestroyed. |
| 23 void BubbleViewDestroyed(); | 23 void BubbleViewDestroyed(); |
| 24 | 24 |
| 25 // Sets/Gets the maximum height of the bubble view. Setting 0 changes the | 25 // 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 | 26 // bubble to the default size. max_height() will return the default size |
| 27 // if SetMaxHeight() has not been called yet. | 27 // if SetMaxHeight() has not been called yet. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 54 | 54 |
| 55 views::TrayBubbleView* bubble_view() const { return bubble_view_; } | 55 views::TrayBubbleView* bubble_view() const { return bubble_view_; } |
| 56 | 56 |
| 57 static const SkColor kBackgroundColor; | 57 static const SkColor kBackgroundColor; |
| 58 static const SkColor kHeaderBackgroundColorLight; | 58 static const SkColor kHeaderBackgroundColorLight; |
| 59 static const SkColor kHeaderBackgroundColorDark; | 59 static const SkColor kHeaderBackgroundColorDark; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 views::TrayBubbleView::InitParams GetDefaultInitParams( | 62 views::TrayBubbleView::InitParams GetDefaultInitParams( |
| 63 views::TrayBubbleView::AnchorAlignment anchor_alignment); | 63 views::TrayBubbleView::AnchorAlignment anchor_alignment); |
| 64 NotificationList::Delegate* list_delegate() { return list_delegate_; } | 64 MessageCenter* message_center() { return message_center_; } |
| 65 void set_bubble_view(views::TrayBubbleView* bubble_view) { | 65 void set_bubble_view(views::TrayBubbleView* bubble_view) { |
| 66 bubble_view_ = bubble_view; | 66 bubble_view_ = bubble_view; |
| 67 } | 67 } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 NotificationList::Delegate* list_delegate_; | 70 MessageCenter* message_center_; |
| 71 views::TrayBubbleView* bubble_view_; | 71 views::TrayBubbleView* bubble_view_; |
| 72 base::WeakPtrFactory<MessageBubbleBase> weak_ptr_factory_; | 72 base::WeakPtrFactory<MessageBubbleBase> weak_ptr_factory_; |
| 73 int max_height_; | 73 int max_height_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(MessageBubbleBase); | 75 DISALLOW_COPY_AND_ASSIGN(MessageBubbleBase); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace message_center | 78 } // namespace message_center |
| 79 | 79 |
| 80 #endif // UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ | 80 #endif // UI_MESSAGE_CENTER_MESSAGE_BUBBLE_BASE_H_ |
| OLD | NEW |