Move mojo gypfiles to toplevel mojo
[chromium-blink-merge.git] / ui / message_center / views / message_center_bubble.h
blob4ca79488d0c0039ff7f5e24fca764b7d993aa0a0
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_CENTER_BUBBLE_H_
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUBBLE_H_
8 #include "base/memory/weak_ptr.h"
9 #include "ui/message_center/message_center_export.h"
10 #include "ui/message_center/views/message_bubble_base.h"
11 #include "ui/views/widget/widget_observer.h"
13 namespace message_center {
15 class MessageCenterView;
17 // Bubble for message center.
18 class MESSAGE_CENTER_EXPORT MessageCenterBubble
19 : public MessageBubbleBase,
20 public views::WidgetObserver,
21 public base::SupportsWeakPtr<MessageCenterBubble> {
22 public:
23 MessageCenterBubble(MessageCenter* message_center,
24 MessageCenterTray* tray,
25 bool first_item_has_no_margin);
27 ~MessageCenterBubble() override;
29 void SetSettingsVisible();
31 // Overridden from views::WidgetObserver:
32 void OnWidgetClosing(views::Widget* widget) override;
34 // Overridden from MessageBubbleBase:
35 views::TrayBubbleView::InitParams GetInitParams(
36 views::TrayBubbleView::AnchorAlignment anchor_alignment) override;
37 void InitializeContents(views::TrayBubbleView* bubble_view) override;
38 void OnBubbleViewDestroyed() override;
39 void UpdateBubbleView() override;
40 void OnMouseEnteredView() override;
41 void OnMouseExitedView() override;
43 size_t NumMessageViewsForTest() const;
45 private:
46 MessageCenterView* message_center_view_;
48 // The maximum height
49 int max_height_;
51 // Use settings view as the initially visible content if true.
52 bool initially_settings_visible_;
54 // True if the first message which gets shown should have no margin against
55 // the used anchor.
56 bool first_item_has_no_margin_;
58 base::string16 title_;
60 DISALLOW_COPY_AND_ASSIGN(MessageCenterBubble);
63 } // namespace message_center
65 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_CENTER_BUBBLE_H_