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

Unified Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 years, 4 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/mus/bridge/wm_shell_mus.h ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/bridge/wm_shell_mus.cc
diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
index e13fbffd63d95fb9001c6973fbd5ea26556ea3b3..0e71dfb3a23006e9f77be9c0e85739ec5c36aca8 100644
--- a/ash/mus/bridge/wm_shell_mus.cc
+++ b/ash/mus/bridge/wm_shell_mus.cc
@@ -155,6 +155,9 @@ WmShellMus* WmShellMus::Get() {
void WmShellMus::AddRootWindowController(
WmRootWindowControllerMus* controller) {
root_window_controllers_.push_back(controller);
+ // The first root window will be the initial root for new windows.
+ if (!GetRootWindowForNewWindows())
+ set_root_window_for_new_windows(controller->GetWindow());
}
void WmShellMus::RemoveRootWindowController(
@@ -206,11 +209,6 @@ WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) {
return GetRootWindowControllerWithDisplayId(display_id)->GetWindow();
}
-WmWindow* WmShellMus::GetRootWindowForNewWindows() {
- NOTIMPLEMENTED();
- return root_window_controllers_[0]->GetWindow();
-}
-
const DisplayInfo& WmShellMus::GetDisplayInfo(int64_t display_id) const {
NOTIMPLEMENTED();
static DisplayInfo fake_info;
@@ -357,8 +355,11 @@ bool WmShellMus::IsActivationParent(ui::Window* window) {
// TODO: support OnAttemptToReactivateWindow, http://crbug.com/615114.
void WmShellMus::OnWindowTreeFocusChanged(ui::Window* gained_focus,
ui::Window* lost_focus) {
- WmWindowMus* gained_active = GetToplevelAncestor(gained_focus);
- WmWindowMus* lost_active = GetToplevelAncestor(gained_focus);
+ WmWindow* gained_active = GetToplevelAncestor(gained_focus);
+ if (gained_active)
+ set_root_window_for_new_windows(gained_active->GetRootWindow());
+
+ WmWindow* lost_active = GetToplevelAncestor(gained_focus);
if (gained_active == lost_active)
return;
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698