1 // Copyright 2014 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_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
12 #include "ui/message_center/notification_blocker.h"
15 class MultiUserWindowManager
;
18 // A notification blocker for per-profile stream switching. Owned and controlled
19 // by MultiUserWindowManagerChromeOS.
20 class MultiUserNotificationBlockerChromeOS
21 : public message_center::NotificationBlocker
{
23 MultiUserNotificationBlockerChromeOS(
24 message_center::MessageCenter
* message_center
,
25 chrome::MultiUserWindowManager
* multi_user_window_manager
);
26 virtual ~MultiUserNotificationBlockerChromeOS();
28 // Checks the current desktop and update the list of users which owns windows
29 // on the current desktop.
30 void UpdateWindowOwners();
32 // Called by MultiUserWindowManager when the active user has changed.
33 void ActiveUserChanged(const std::string
& user_id
);
35 // message_center::NotificationBlocker overrides:
36 virtual bool ShouldShowNotification(
37 const message_center::NotifierId
& notifier_id
) const OVERRIDE
;
38 virtual bool ShouldShowNotificationAsPopup(
39 const message_center::NotifierId
& notifier_id
) const OVERRIDE
;
42 // Returns true if this blocker is actively working.
43 bool IsActive() const;
45 chrome::MultiUserWindowManager
* multi_user_window_manager_
; // Weak.
46 std::string active_user_id_
;
47 std::map
<std::string
, bool> quiet_modes_
;
48 std::set
<std::string
> current_user_ids_
;
50 DISALLOW_COPY_AND_ASSIGN(MultiUserNotificationBlockerChromeOS
);
53 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_