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

Unified Diff: ash/common/wm/window_positioning_utils.cc

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 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/common/wm/window_dimmer.cc ('k') | ash/common/wm/wm_toplevel_window_event_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/window_positioning_utils.cc
diff --git a/ash/common/wm/window_positioning_utils.cc b/ash/common/wm/window_positioning_utils.cc
index aac2949383505fd7346dd8621de1138098bb3906..075090e397681eff224815a6394474c03ea5462f 100644
--- a/ash/common/wm/window_positioning_utils.cc
+++ b/ash/common/wm/window_positioning_utils.cc
@@ -13,8 +13,8 @@
#include "ash/common/wm_lookup.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
-#include "ash/common/wm_window_tracker.h"
#include "ash/root_window_controller.h"
+#include "ui/aura/window_tracker.h"
#include "ui/display/display.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/geometry/rect.h"
@@ -157,11 +157,11 @@ void SetBoundsInScreen(WmWindow* window,
WmWindow* focused = WmShell::Get()->GetFocusedWindow();
WmWindow* active = WmShell::Get()->GetActiveWindow();
- WmWindowTracker tracker;
+ aura::WindowTracker tracker;
if (focused)
- tracker.Add(focused);
+ tracker.Add(focused->aura_window());
if (active && focused != active)
- tracker.Add(active);
+ tracker.Add(active->aura_window());
gfx::Point origin = bounds_in_screen.origin();
const gfx::Point display_origin = display.bounds().origin();
@@ -177,11 +177,11 @@ void SetBoundsInScreen(WmWindow* window,
MoveAllTransientChildrenToNewRoot(display, window);
// Restore focused/active window.
- if (tracker.Contains(focused)) {
+ if (focused && tracker.Contains(focused->aura_window())) {
focused->SetFocused();
WmShell::Get()->set_root_window_for_new_windows(
focused->GetRootWindow());
- } else if (tracker.Contains(active)) {
+ } else if (active && tracker.Contains(active->aura_window())) {
active->Activate();
}
// TODO(oshima): We should not have to update the bounds again
« no previous file with comments | « ash/common/wm/window_dimmer.cc ('k') | ash/common/wm/wm_toplevel_window_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698