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

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: base file upload 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/notifications/multi_user_notification_blocker_chromeos.h b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h
similarity index 54%
rename from chrome/browser/notifications/multi_user_notification_blocker_chromeos.h
rename to chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h
index 6dd92fa56c5bec1a77691f15720c227b26e1692b..30bbcfa540c1ce9ce3d5bb40dbec93c96f450cc5 100644
--- a/chrome/browser/notifications/multi_user_notification_blocker_chromeos.h
+++ b/chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h
@@ -2,48 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_NOTIFICATIONS_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
-#define CHROME_BROWSER_NOTIFICATIONS_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
+#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 "ash/shell_observer.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
-#include "chromeos/login/login_state.h"
#include "ui/message_center/notification_blocker.h"
-// A notification blocker for per-profile stream switching.
+// A notification blocker for per-profile stream switching. Owned and controlled
+// by MultiUserWindowManagerChromeOS.
class MultiUserNotificationBlockerChromeOS
- : public message_center::NotificationBlocker,
- public ash::ShellObserver,
- public chromeos::UserManager::UserSessionStateObserver {
+ : public message_center::NotificationBlocker {
public:
explicit MultiUserNotificationBlockerChromeOS(
message_center::MessageCenter* message_center);
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 the active user has changed.
Mr4D (OOO till 08-26) 2014/01/08 17:29:35 nit: .. when the active ..
Jun Mukai 2014/01/08 20:41:24 Done.
+ 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;
- // ash::ShellObserver overrides:
- virtual void OnAppTerminating() OVERRIDE;
-
- // chromeos::UserManager::UserSessionStateObserver overrides:
- virtual void ActiveUserChanged(const chromeos::User* active_user) OVERRIDE;
-
private:
// Returns true if this blocker is actively working.
bool IsActive() const;
std::string active_user_id_;
- bool observing_;
std::map<std::string, bool> quiet_modes_;
+ std::set<std::string> current_user_ids_;
DISALLOW_COPY_AND_ASSIGN(MultiUserNotificationBlockerChromeOS);
};
-#endif // CHROME_BROWSER_NOTIFICATIONS_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_
+#endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_NOTIFICATION_BLOCKER_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698