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

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

Issue 2503623002: Support creation of toplevel mus::Windows on separate displays (Closed)
Patch Set: Clean up/format code. 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/bridge/wm_root_window_controller_mus.cc
diff --git a/ash/mus/bridge/wm_root_window_controller_mus.cc b/ash/mus/bridge/wm_root_window_controller_mus.cc
index ff89cb61f33b7aec51a3600131d41abf2f71041d..1e450c928176bf1085aec51ec4ed00ef15e992fb 100644
--- a/ash/mus/bridge/wm_root_window_controller_mus.cc
+++ b/ash/mus/bridge/wm_root_window_controller_mus.cc
@@ -49,10 +49,26 @@ const WmRootWindowControllerMus* WmRootWindowControllerMus::Get(
const ui::Window* window) {
if (!window)
return nullptr;
-
return window->GetRoot()->GetLocalProperty(kWmRootWindowControllerKey);
}
+gfx::Rect* WmRootWindowControllerMus::ConvertWindowToScreen(
+ const WmWindowMus* source,
+ const ui::Window* window) const {
+ gfx::Point screen_point_top_right =
+ ConvertPointToScreen(source, window->bounds().top_right());
+
+ gfx::Point screen_point_bottom_left =
+ ConvertPointToScreen(source, window->bounds().bottom_left());
+
+ gfx::Rect* screen_bound =
+ new 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());
+
+ return screen_bound;
+}
+
gfx::Point WmRootWindowControllerMus::ConvertPointToScreen(
const WmWindowMus* source,
const gfx::Point& point) const {

Powered by Google App Engine
This is Rietveld 408576698