1 // Copyright 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_
6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_
8 #include "base/gtest_prod_util.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/message_center/message_center_tray_delegate.h"
11 #include "ui/views/widget/widget_observer.h"
15 namespace message_center
{
16 class DesktopPopupAlignmentDelegate
;
18 class MessageCenterTray
;
19 class MessagePopupCollection
;
21 // A MessageCenterTrayDelegate implementation that exposes the MessageCenterTray
22 // via a system tray icon. The notification popups will be displayed in the
23 // corner of the screen and the message center will be displayed by the system
24 // tray icon on click.
25 class WebNotificationTray
: public message_center::MessageCenterTrayDelegate
{
27 WebNotificationTray();
28 ~WebNotificationTray() override
;
30 message_center::MessageCenter
* message_center();
32 // MessageCenterTrayDelegate implementation.
33 bool ShowPopups() override
;
34 void HidePopups() override
;
35 bool ShowMessageCenter() override
;
36 void HideMessageCenter() override
;
37 void OnMessageCenterTrayChanged() override
;
38 bool ShowNotifierSettings() override
;
39 bool IsContextMenuEnabled() const override
;
41 MessageCenterTray
* GetMessageCenterTray() override
;
44 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest
, WebNotifications
);
45 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest
, WebNotificationPopupBubble
);
46 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest
, ManyPopupNotifications
);
47 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest
, ManuallyCloseMessageCenter
);
49 scoped_ptr
<MessagePopupCollection
> popup_collection_
;
50 scoped_ptr
<DesktopPopupAlignmentDelegate
> alignment_delegate_
;
52 scoped_ptr
<MessageCenterTray
> message_center_tray_
;
53 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray
);
56 } // namespace message_center
58 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_