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

Unified Diff: ash/wm/window_positioning_utils.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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/wm/window_positioner_unittest.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_positioning_utils.cc
diff --git a/ash/wm/window_positioning_utils.cc b/ash/wm/window_positioning_utils.cc
index f733954912234bafea97c2b8cfdc140557dec81c..918f3e83211921ccbc8b0db1f721d0d071cbb669 100644
--- a/ash/wm/window_positioning_utils.cc
+++ b/ash/wm/window_positioning_utils.cc
@@ -14,6 +14,7 @@
#include "ash/wm/window_util.h"
#include "ash/wm/wm_event.h"
#include "ash/wm_window.h"
+#include "ui/aura/client/focus_client.h"
#include "ui/aura/window_tracker.h"
#include "ui/display/display.h"
#include "ui/display/types/display_constants.h"
@@ -158,14 +159,14 @@ void SetBoundsInScreen(WmWindow* window,
}
if (dst_container && window->GetParent() != dst_container) {
- WmWindow* focused = WmWindow::Get(GetFocusedWindow());
- WmWindow* active = WmWindow::Get(GetActiveWindow());
+ aura::Window* focused = GetFocusedWindow();
+ aura::Window* active = GetActiveWindow();
aura::WindowTracker tracker;
if (focused)
- tracker.Add(focused->aura_window());
+ tracker.Add(focused);
if (active && focused != active)
- tracker.Add(active->aura_window());
+ tracker.Add(active);
gfx::Point origin = bounds_in_screen.origin();
const gfx::Point display_origin = display.bounds().origin();
@@ -181,11 +182,11 @@ void SetBoundsInScreen(WmWindow* window,
MoveAllTransientChildrenToNewRoot(display, window);
// Restore focused/active window.
- if (focused && tracker.Contains(focused->aura_window())) {
- focused->SetFocused();
+ if (focused && tracker.Contains(focused)) {
+ aura::client::GetFocusClient(focused)->FocusWindow(focused);
Shell::Get()->set_root_window_for_new_windows(focused->GetRootWindow());
- } else if (active && tracker.Contains(active->aura_window())) {
- active->Activate();
+ } else if (active && tracker.Contains(active)) {
+ wm::ActivateWindow(active);
}
// TODO(oshima): We should not have to update the bounds again
// below in theory, but we currently do need as there is a code
« no previous file with comments | « ash/wm/window_positioner_unittest.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698