Home | History | Annotate | Download | only in multi_user
      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.
      4 
      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_
      7 
      8 #include <map>
      9 #include <set>
     10 #include <string>
     11 
     12 #include "ui/message_center/notification_blocker.h"
     13 
     14 // A notification blocker for per-profile stream switching. Owned and controlled
     15 // by MultiUserWindowManagerChromeOS.
     16 class MultiUserNotificationBlockerChromeOS
     17     : public message_center::NotificationBlocker {
     18  public:
     19   MultiUserNotificationBlockerChromeOS(
     20       message_center::MessageCenter* message_center,
     21       const std::string& initial_user_id);
     22   virtual ~MultiUserNotificationBlockerChromeOS();
     23 
     24   // Called by MultiUserWindowManager when the active user has changed.
     25   void ActiveUserChanged(const std::string& user_id);
     26 
     27   // message_center::NotificationBlocker overrides:
     28   virtual bool ShouldShowNotification(
     29       const message_center::NotifierId& notifier_id) const OVERRIDE;
     30   virtual bool ShouldShowNotificationAsPopup(
     31       const message_center::NotifierId& notifier_id) const OVERRIDE;
     32 
     33  private:
     34   // Returns true if this blocker is actively working.
     35   bool IsActive() const;
     36 
     37   std::string active_user_id_;
     38   std::map<std::string, bool> quiet_modes_;
     39 
     40   DISALLOW_COPY_AND_ASSIGN(MultiUserNotificationBlockerChromeOS);
     41 };
     42 
     43 #endif  // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
     44