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
3 // found in the LICENSE file.
5 #ifndef UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_
6 #define UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_
8 #include "base/timer.h"
9 #include "ui/message_center/message_bubble_base.h"
10 #include "ui/message_center/message_center_export.h"
11 #include "ui/message_center/notification_list.h"
13 namespace message_center
{
15 class PopupBubbleContentsView
;
17 // Bubble for popup notifications.
18 class MESSAGE_CENTER_EXPORT MessagePopupBubble
: public MessageBubbleBase
{
20 explicit MessagePopupBubble(NotificationList::Delegate
* delegate
);
22 virtual ~MessagePopupBubble();
24 // Overridden from MessageBubbleBase.
25 virtual views::TrayBubbleView::InitParams
GetInitParams(
26 views::TrayBubbleView::AnchorAlignment anchor_alignment
) OVERRIDE
;
27 virtual void InitializeContents(views::TrayBubbleView
* bubble_view
) OVERRIDE
;
28 virtual void OnBubbleViewDestroyed() OVERRIDE
;
29 virtual void UpdateBubbleView() OVERRIDE
;
30 virtual void OnMouseEnteredView() OVERRIDE
;
31 virtual void OnMouseExitedView() OVERRIDE
;
33 size_t NumMessageViewsForTest() const;
36 void StartAutoCloseTimer(int priority
);
37 void StopAutoCloseTimer();
39 void OnAutoClose(int priority
);
41 base::OneShotTimer
<MessagePopupBubble
> autoclose_default_
;
42 base::OneShotTimer
<MessagePopupBubble
> autoclose_high_
;
43 PopupBubbleContentsView
* contents_view_
;
44 NotificationList::Notifications popup_notifications_
;
45 bool should_run_default_timer_
;
46 bool should_run_high_timer_
;
48 DISALLOW_COPY_AND_ASSIGN(MessagePopupBubble
);
51 } // namespace message_center
53 #endif // UI_MESSAGE_CENTER_MESSAGE_POPUP_BUBBLE_H_