| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEO
S_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEO
S_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEO
S_H_ | 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEO
S_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "components/user_manager/user_id.h" |
| 12 #include "ui/message_center/notification_blocker.h" | 13 #include "ui/message_center/notification_blocker.h" |
| 13 | 14 |
| 14 // A notification blocker for per-profile stream switching. Owned and controlled | 15 // A notification blocker for per-profile stream switching. Owned and controlled |
| 15 // by MultiUserWindowManagerChromeOS. | 16 // by MultiUserWindowManagerChromeOS. |
| 16 class MultiUserNotificationBlockerChromeOS | 17 class MultiUserNotificationBlockerChromeOS |
| 17 : public message_center::NotificationBlocker { | 18 : public message_center::NotificationBlocker { |
| 18 public: | 19 public: |
| 19 MultiUserNotificationBlockerChromeOS( | 20 MultiUserNotificationBlockerChromeOS( |
| 20 message_center::MessageCenter* message_center, | 21 message_center::MessageCenter* message_center, |
| 21 const std::string& initial_user_id); | 22 const user_manager::UserID& initial_user_id); |
| 22 ~MultiUserNotificationBlockerChromeOS() override; | 23 ~MultiUserNotificationBlockerChromeOS() override; |
| 23 | 24 |
| 24 // Called by MultiUserWindowManager when the active user has changed. | 25 // Called by MultiUserWindowManager when the active user has changed. |
| 25 void ActiveUserChanged(const std::string& user_id); | 26 void ActiveUserChanged(const user_manager::UserID& user_id); |
| 26 | 27 |
| 27 // message_center::NotificationBlocker overrides: | 28 // message_center::NotificationBlocker overrides: |
| 28 bool ShouldShowNotification( | 29 bool ShouldShowNotification( |
| 29 const message_center::NotifierId& notifier_id) const override; | 30 const message_center::NotifierId& notifier_id) const override; |
| 30 bool ShouldShowNotificationAsPopup( | 31 bool ShouldShowNotificationAsPopup( |
| 31 const message_center::NotifierId& notifier_id) const override; | 32 const message_center::NotifierId& notifier_id) const override; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 // Returns true if this blocker is actively working. | 35 // Returns true if this blocker is actively working. |
| 35 bool IsActive() const; | 36 bool IsActive() const; |
| 36 | 37 |
| 37 std::string active_user_id_; | 38 user_manager::UserID active_user_id_; |
| 38 std::map<std::string, bool> quiet_modes_; | 39 std::map<user_manager::UserID, bool> quiet_modes_; |
| 39 | 40 |
| 40 DISALLOW_COPY_AND_ASSIGN(MultiUserNotificationBlockerChromeOS); | 41 DISALLOW_COPY_AND_ASSIGN(MultiUserNotificationBlockerChromeOS); |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHRO
MEOS_H_ | 44 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHRO
MEOS_H_ |
| OLD | NEW |