Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / message_center / views / message_popup_bubble.h
blob671c0b667e82d7a8e97d416f4ddd8b5b297c812d
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_VIEWS_MESSAGE_POPUP_BUBBLE_H_
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_BUBBLE_H_
8 #include <map>
9 #include <set>
10 #include <string>
12 #include "base/timer.h"
13 #include "ui/message_center/message_center_export.h"
14 #include "ui/message_center/views/message_bubble_base.h"
16 namespace message_center {
18 class PopupBubbleContentsView;
20 // Bubble for popup notifications.
21 class MESSAGE_CENTER_EXPORT MessagePopupBubble : public MessageBubbleBase {
22 public:
23 explicit MessagePopupBubble(MessageCenter* message_center);
25 virtual ~MessagePopupBubble();
27 // Overridden from MessageBubbleBase:
28 virtual views::TrayBubbleView::InitParams GetInitParams(
29 views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE;
30 virtual void InitializeContents(views::TrayBubbleView* bubble_view) OVERRIDE;
31 virtual void OnBubbleViewDestroyed() OVERRIDE;
32 virtual void UpdateBubbleView() OVERRIDE;
33 virtual void OnMouseEnteredView() OVERRIDE;
34 virtual void OnMouseExitedView() OVERRIDE;
36 size_t NumMessageViewsForTest() const;
38 private:
39 class AutocloseTimer;
41 void OnAutoClose(const std::string& id);
43 void DeleteTimer(const std::string& id);
45 std::map<std::string, AutocloseTimer*> autoclose_timers_;
46 PopupBubbleContentsView* contents_view_;
47 std::set<std::string> popup_ids_;
49 DISALLOW_COPY_AND_ASSIGN(MessagePopupBubble);
52 } // namespace message_center
54 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_BUBBLE_H_