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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc

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_window_manager_chromeos.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
index 3e3d98c3df7ad27643c77b21f79dcbc144caa766..3c049db7f7ad71f83fe07b2b48de3bacc173b305 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -36,6 +37,7 @@
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"
#include "ui/events/event.h"
+#include "ui/message_center/message_center.h"
namespace {
@@ -176,6 +178,8 @@ class AppObserver : public apps::ShellWindowRegistry::Observer {
MultiUserWindowManagerChromeOS::MultiUserWindowManagerChromeOS(
const std::string& current_user_id)
: current_user_id_(current_user_id),
+ notification_blocker_(new MultiUserNotificationBlockerChromeOS(
+ message_center::MessageCenter::Get())),
suppress_visibility_changes_(false) {
// Add a session state observer to be able to monitor session changes.
if (ash::Shell::HasInstance())
@@ -247,6 +251,8 @@ void MultiUserWindowManagerChromeOS::SetWindowOwner(
// will add the children but not the owner to the transient children map.
AddTransientOwnerRecursive(window, window);
+ notification_blocker_->UpdateWindowOwners();
Mr4D (OOO till 08-26) 2014/01/08 17:29:35 At the moment we have only this use case, but we m
Jun Mukai 2014/01/08 20:41:24 Done.
+
if (!IsWindowOnDesktopOfUser(window, current_user_id_))
SetWindowVisibility(window, false);
}
@@ -294,6 +300,8 @@ void MultiUserWindowManagerChromeOS::ShowWindowForUser(
} else {
SetWindowVisibility(window, false);
}
+
+ notification_blocker_->UpdateWindowOwners();
Mr4D (OOO till 08-26) 2014/01/08 17:29:35 See above
Jun Mukai 2014/01/08 20:41:24 Done.
}
bool MultiUserWindowManagerChromeOS::AreWindowsSharedAmongUsers() {
@@ -405,6 +413,10 @@ void MultiUserWindowManagerChromeOS::ActiveUserChanged(
client->ActivateWindow(window);
}
}
+
+ // This is called directly here to make sure notification_blocker will see the
+ // new window status.
+ notification_blocker_->ActiveUserChanged(user_id);
}
void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) {
@@ -419,6 +431,7 @@ void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) {
// Remove the window from the owners list.
delete window_to_entry_[window];
window_to_entry_.erase(window);
+ notification_blocker_->UpdateWindowOwners();
Mr4D (OOO till 08-26) 2014/01/08 17:29:35 And again.
Jun Mukai 2014/01/08 20:41:24 Done.
}
void MultiUserWindowManagerChromeOS::OnWindowVisibilityChanging(

Powered by Google App Engine
This is Rietveld 408576698