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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Add blank line back. Created 4 years, 1 month 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: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index 4279731f0df65714c0b6267737bf9c288226dab0..7c7bdae6baf8d6595035ac364e037dd534117f76 100644
--- a/ash/mus/root_window_controller.cc
+++ b/ash/mus/root_window_controller.cc
@@ -102,9 +102,21 @@ ui::Window* RootWindowController::NewTopLevelWindow(
if (GetRequestedContainer(window, &container_id)) {
container_window = GetWindowByShellWindowId(container_id)->mus_window();
} else {
- // TODO(sky): window->bounds() isn't quite right.
+ const gfx::Point& screen_point_top_right =
mfomitchev 2016/11/18 17:36:24 Nit: Any particular reason you are using const ref
thanhph 2016/11/18 19:15:44 Done.
+ wm_root_window_controller_->ConvertPointToScreen(
+ WmWindowMus::Get(window), window->bounds().top_right());
+
+ const gfx::Point& screen_point_bottom_left =
+ wm_root_window_controller_->ConvertPointToScreen(
+ WmWindowMus::Get(window), window->bounds().bottom_left());
+
+ const gfx::Rect& screen_bound =
mfomitchev 2016/11/18 17:36:24 The variable name is a little confusing - sounds l
thanhph 2016/11/18 19:15:44 Done. Thanks!
+ gfx::Rect(screen_point_bottom_left.x(), screen_point_top_right.y(),
+ screen_point_top_right.x() - screen_point_bottom_left.x(),
+ screen_point_bottom_left.y() - screen_point_top_right.y());
+
container_window = WmWindowMus::GetMusWindow(wm::GetDefaultParent(
- WmWindowMus::Get(root_), WmWindowMus::Get(window), window->bounds()));
+ WmWindowMus::Get(root_), WmWindowMus::Get(window), screen_bound));
}
DCHECK(WmWindowMus::Get(container_window)->IsContainer());
@@ -114,9 +126,7 @@ ui::Window* RootWindowController::NewTopLevelWindow(
} else {
container_window->AddChild(window);
}
-
window_count_++;
-
return window;
}

Powered by Google App Engine
This is Rietveld 408576698