Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ui/message_center/message_center_tray.h

Issue 11819048: Implement message center on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with master, address comments. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 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.
4
5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_H_
6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_H_
7
8 #include "base/observer_list.h"
9 #include "ui/message_center/message_center.h"
10 #include "ui/message_center/message_center_export.h"
11 #include "ui/views/bubble/tray_bubble_view.h"
12
13 namespace message_center {
14 class MessageBubbleBase;
15 class MessagePopupBubble;
16 class QuietModeBubble;
17 }
18
19 namespace views {
20 class Widget;
21 }
22
23 namespace ui {
24
Pete Williamson 2013/01/24 19:41:59 Put MessageCenterTrayDelegate into its own .h file
dewittj 2013/01/25 00:49:04 Done.
25 class MessageCenterTrayDelegate {
26 public:
27 static MessageCenterTrayDelegate* CreateForPlatform();
28 virtual ~MessageCenterTrayDelegate() {};
29
30 virtual void OnMessageCenterTrayChanged() = 0;
31 virtual bool ShowPopups(message_center::MessageBubbleBase* bubble) = 0;
32 virtual void HidePopups() = 0;
33 virtual void UpdatePopups() = 0;
34 virtual bool ShowMessageCenter(message_center::MessageBubbleBase* bubble) = 0;
35 virtual void HideMessageCenter() = 0;
36 virtual void UpdateMessageCenter() = 0;
37 };
38
39 // Class that observes a MessageCenter. Manages the popup and message center
40 // bubbles. Tells the MessageCenterTrayHost when the tray is changed, as well
41 // as when bubbles are shown and hidden.
42 class MESSAGE_CENTER_EXPORT MessageCenterTray
43 : public message_center::MessageCenter::Observer {
44 public:
45 MessageCenterTray(MessageCenterTrayDelegate* delegate,
46 message_center::MessageCenter* message_center);
47 virtual ~MessageCenterTray();
48
49 // Shows or updates the message center bubble and hides the popup bubble.
50 void ShowMessageCenterBubble();
51
52 // Returns whether the message center was visible before.
53 bool HideMessageCenterBubble();
54
55 void ToggleMessageCenterBubble();
56
57 // Causes an update if the popup bubble is already shown.
58 void ShowPopupBubble();
59
60 // Returns whether the popup was visible before.
61 bool HidePopupBubble();
62
63 bool message_center_visible() { return message_center_visible_; }
64 bool popups_visible() { return popups_visible_; }
65 MessageCenterTrayDelegate* delegate() { return delegate_; }
66 message_center::MessageCenter* message_center() { return message_center_; }
67
68 // Overridden from message_center::MessageCenter::Observer.
69 virtual void OnMessageCenterChanged(bool new_notification) OVERRIDE;
70
71 private:
72 void NotifyMessageCenterTrayChanged();
73
Pete Williamson 2013/01/24 19:41:59 Let's add comments about ownership of the message
dewittj 2013/01/25 00:49:04 Done.
74 message_center::MessageCenter* message_center_;
75 bool message_center_visible_;
76 bool popups_visible_;
77 MessageCenterTrayDelegate* delegate_;
78
79 DISALLOW_COPY_AND_ASSIGN(MessageCenterTray);
80 };
81
82 } // namespace ui
83
84 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698