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

Unified Diff: ash/shelf/shelf_window_watcher.cc

Issue 2041423003: Converts ShellObserver from aura::Window to ash::WmWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « ash/shelf/shelf_window_watcher.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_window_watcher.cc
diff --git a/ash/shelf/shelf_window_watcher.cc b/ash/shelf/shelf_window_watcher.cc
index 10f306cf5a682101271c3a4f481d6b48b987529c..0997d68906125bbadd4a003f6b67574ba0b68db5 100644
--- a/ash/shelf/shelf_window_watcher.cc
+++ b/ash/shelf/shelf_window_watcher.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "ash/aura/wm_window_aura.h"
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/shelf_item_delegate_manager.h"
#include "ash/common/shelf/shelf_model.h"
@@ -116,10 +117,8 @@ ShelfWindowWatcher::ShelfWindowWatcher(
observed_activation_clients_(this) {
// We can't assume all RootWindows have the same ActivationClient.
// Add a RootWindow and its ActivationClient to the observed list.
- aura::Window::Windows root_windows = Shell::GetAllRootWindows();
- for (aura::Window::Windows::const_iterator it = root_windows.begin();
- it != root_windows.end(); ++it)
- OnRootWindowAdded(*it);
+ for (aura::Window* root : Shell::GetAllRootWindows())
+ OnRootWindowAdded(WmWindowAura::Get(root));
display::Screen::GetScreen()->AddObserver(this);
}
@@ -148,7 +147,8 @@ void ShelfWindowWatcher::RemoveShelfItem(aura::Window* window) {
SetShelfIDForWindow(kInvalidShelfID, window);
}
-void ShelfWindowWatcher::OnRootWindowAdded(aura::Window* root_window) {
+void ShelfWindowWatcher::OnRootWindowAdded(WmWindow* root_window_wm) {
+ aura::Window* root_window = WmWindowAura::GetAuraWindow(root_window_wm);
// |observed_activation_clients_| can have the same ActivationClient multiple
// times - which would be handled by the |observed_activation_clients_|.
observed_activation_clients_.Add(
@@ -278,7 +278,7 @@ void ShelfWindowWatcher::OnDisplayAdded(const display::Display& new_display) {
// When the primary root window's display get removed, the existing root
// window is taken over by the new display and the observer is already set.
if (!observed_root_windows_.IsObserving(root_window))
- OnRootWindowAdded(root_window);
+ OnRootWindowAdded(WmWindowAura::Get(root_window));
}
void ShelfWindowWatcher::OnDisplayRemoved(const display::Display& old_display) {
« no previous file with comments | « ash/shelf/shelf_window_watcher.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698