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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h

Issue 127423002: Supports window teleports for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix wallpaper private api test Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e9c392d6faf47743d86e405d63fa9772020c0f2
--- /dev/null
+++ b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h
@@ -0,0 +1,53 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
+#define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "ui/message_center/notification_blocker.h"
+
+namespace chrome {
+class MultiUserWindowManager;
+}
+
+// A notification blocker for per-profile stream switching. Owned and controlled
+// by MultiUserWindowManagerChromeOS.
+class MultiUserNotificationBlockerChromeOS
+ : public message_center::NotificationBlocker {
+ public:
+ MultiUserNotificationBlockerChromeOS(
+ message_center::MessageCenter* message_center,
+ chrome::MultiUserWindowManager* multi_user_window_manager);
+ virtual ~MultiUserNotificationBlockerChromeOS();
+
+ // Checks the current desktop and update the list of users which owns windows
+ // on the current desktop.
+ void UpdateWindowOwners();
+
+ // Called by MultiUserWindowManager when the active user has changed.
+ void ActiveUserChanged(const std::string& user_id);
+
+ // message_center::NotificationBlocker overrides:
+ virtual bool ShouldShowNotification(
+ const message_center::NotifierId& notifier_id) const OVERRIDE;
+ virtual bool ShouldShowNotificationAsPopup(
+ const message_center::NotifierId& notifier_id) const OVERRIDE;
+
+ private:
+ // Returns true if this blocker is actively working.
+ bool IsActive() const;
+
+ chrome::MultiUserWindowManager* multi_user_window_manager_; // Weak.
+ std::string active_user_id_;
+ std::map<std::string, bool> quiet_modes_;
+ std::set<std::string> current_user_ids_;
+
+ DISALLOW_COPY_AND_ASSIGN(MultiUserNotificationBlockerChromeOS);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698