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

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: Address petewil & stevenjb comments. Move MessageCenterTrayDelegate to its own class. 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/message_center/message_center_tray_delegate.h"
12
13 namespace message_center {
14
15 class MessageBubbleBase;
16 class MessagePopupBubble;
17 class QuietModeBubble;
18
19 // Implementation found with each supported platform's implementation of
20 // MessageCenterTrayDelegate.
21 MessageCenterTrayDelegate* CreateMessageCenterTray();
22
23 // Class that observes a MessageCenter. Manages the popup and message center
miket_OOO 2013/01/25 17:14:48 That Slate article again
dewittj 2013/01/25 19:38:46 Done.
24 // bubbles. Tells the MessageCenterTrayHost when the tray is changed, as well
25 // as when bubbles are shown and hidden.
26 class MESSAGE_CENTER_EXPORT MessageCenterTray
27 : public message_center::MessageCenter::Observer {
28 public:
29 MessageCenterTray(MessageCenterTrayDelegate* delegate,
30 message_center::MessageCenter* message_center);
31 virtual ~MessageCenterTray();
32
33 // Shows or updates the message center bubble and hides the popup bubble.
34 void ShowMessageCenterBubble();
35
36 // Returns whether the message center was visible before.
37 bool HideMessageCenterBubble();
38
39 void ToggleMessageCenterBubble();
40
41 // Causes an update if the popup bubble is already shown.
42 void ShowPopupBubble();
43
44 // Returns whether the popup was visible before.
45 bool HidePopupBubble();
46
47 bool message_center_visible() { return message_center_visible_; }
48 bool popups_visible() { return popups_visible_; }
49 MessageCenterTrayDelegate* delegate() { return delegate_; }
50 message_center::MessageCenter* message_center() { return message_center_; }
51
52 // Overridden from message_center::MessageCenter::Observer.
53 virtual void OnMessageCenterChanged(bool new_notification) OVERRIDE;
54
55 private:
56 void NotifyMessageCenterTrayChanged();
57
58 // |message_center_| is a weak pointer that must live longer than
59 // MessageCenterTray.
60 message_center::MessageCenter* message_center_;
61 bool message_center_visible_;
62 bool popups_visible_;
63 // |delegate_| is a weak pointer that must live longer than MessageCenterTray.
64 MessageCenterTrayDelegate* delegate_;
65
66 DISALLOW_COPY_AND_ASSIGN(MessageCenterTray);
67 };
68
69 } // namespace message_center
70
71 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698