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

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

Issue 132013004: Moves transient window observer methods out of WindowObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments and update gyp 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 43c69d3c0395abccc75a5e041936f7714b6d97d0..168f2281c61cd36a2bf841800c258d5a38c8838f 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
@@ -36,6 +36,7 @@
#include "ui/aura/window.h"
#include "ui/base/ui_base_types.h"
#include "ui/events/event.h"
+#include "ui/views/corewm/transient_window_manager.h"
#include "ui/views/corewm/window_util.h"
namespace {
@@ -235,9 +236,10 @@ void MultiUserWindowManagerChromeOS::SetWindowOwner(
// Remember the initial visibility of the window.
window_to_entry_[window]->set_show(window->IsVisible());
- // Set the window and the state observer.
+ // Add observers to track state changes.
window->AddObserver(this);
ash::wm::GetWindowState(window)->AddObserver(this);
+ views::corewm::TransientWindowManager::Get(window)->AddObserver(this);
// Check if this window was created due to a user interaction. If it was,
// transfer it to the current user.
@@ -415,8 +417,8 @@ void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) {
RemoveTransientOwnerRecursive(window);
return;
}
- // Remove the state and the window observer.
ash::wm::GetWindowState(window)->RemoveObserver(this);
+ views::corewm::TransientWindowManager::Get(window)->RemoveObserver(this);
// Remove the window from the owners list.
delete window_to_entry_[window];
window_to_entry_.erase(window);
@@ -462,7 +464,7 @@ void MultiUserWindowManagerChromeOS::OnWindowVisibilityChanged(
SetWindowVisibility(window, false);
}
-void MultiUserWindowManagerChromeOS::OnAddTransientChild(
+void MultiUserWindowManagerChromeOS::OnTransientChildAdded(
aura::Window* window,
aura::Window* transient_window) {
if (!GetWindowOwner(window).empty()) {
@@ -477,7 +479,7 @@ void MultiUserWindowManagerChromeOS::OnAddTransientChild(
AddTransientOwnerRecursive(transient_window, owned_parent);
}
-void MultiUserWindowManagerChromeOS::OnRemoveTransientChild(
+void MultiUserWindowManagerChromeOS::OnTransientChildRemoved(
aura::Window* window,
aura::Window* transient_window) {
// Remove the transient child if the window itself is owned, or one of the
@@ -605,8 +607,9 @@ void MultiUserWindowManagerChromeOS::AddTransientOwnerRecursive(
transient_window_to_visibility_.end());
transient_window_to_visibility_[window] = window->IsVisible();
- // Add a window observer to make sure that we catch status changes.
+ // Add observers to track state changes.
window->AddObserver(this);
+ views::corewm::TransientWindowManager::Get(window)->AddObserver(this);
// Hide the window if it should not be shown. Note that this hide operation
// will hide recursively this and all children - but we have already collected
@@ -629,8 +632,8 @@ void MultiUserWindowManagerChromeOS::RemoveTransientOwnerRecursive(
transient_window_to_visibility_.find(window);
DCHECK(visibility_item != transient_window_to_visibility_.end());
- // Remove the window observer.
window->RemoveObserver(this);
+ views::corewm::TransientWindowManager::Get(window)->RemoveObserver(this);
bool unowned_view_state = visibility_item->second;
transient_window_to_visibility_.erase(visibility_item);

Powered by Google App Engine
This is Rietveld 408576698