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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_position_client.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 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
Index: ui/views/widget/desktop_aura/desktop_screen_position_client.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
index 08e5d926fad5655380f2af3af714eff1428518b1..1d217402b9d7cd73445fd3204ab182cd1d24f8f2 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
@@ -14,9 +14,9 @@ namespace views {
namespace {
-gfx::Point GetOrigin(const aura::RootWindow* root_window) {
- gfx::Point origin_in_pixels = root_window->GetHostOrigin();
- aura::RootWindow* window = const_cast<aura::RootWindow*>(root_window);
+gfx::Point GetOrigin(const aura::Window* root_window) {
+ gfx::Point origin_in_pixels = root_window->GetDispatcher()->GetHostOrigin();
+ aura::Window* window = const_cast<aura::Window*>(root_window);
float scale = gfx::Screen::GetScreenFor(window)->
GetDisplayNearestWindow(window).device_scale_factor();
return gfx::ToFlooredPoint(
@@ -44,7 +44,7 @@ DesktopScreenPositionClient::~DesktopScreenPositionClient() {
void DesktopScreenPositionClient::ConvertPointToScreen(
const aura::Window* window, gfx::Point* point) {
- const aura::RootWindow* root_window = window->GetRootWindow();
+ const aura::Window* root_window = window->GetRootWindow();
aura::Window::ConvertPointToTarget(window, root_window, point);
gfx::Point origin = GetOrigin(root_window);
point->Offset(origin.x(), origin.y());
@@ -52,7 +52,7 @@ void DesktopScreenPositionClient::ConvertPointToScreen(
void DesktopScreenPositionClient::ConvertPointFromScreen(
const aura::Window* window, gfx::Point* point) {
- const aura::RootWindow* root_window = window->GetRootWindow();
+ const aura::Window* root_window = window->GetRootWindow();
gfx::Point origin = GetOrigin(root_window);
point->Offset(-origin.x(), -origin.y());
aura::Window::ConvertPointToTarget(root_window, window, point);
@@ -60,7 +60,7 @@ void DesktopScreenPositionClient::ConvertPointFromScreen(
void DesktopScreenPositionClient::ConvertHostPointToScreen(
aura::Window* window, gfx::Point* point) {
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
ConvertPointToScreen(root_window, point);
}
@@ -69,7 +69,7 @@ void DesktopScreenPositionClient::SetBounds(
const gfx::Rect& bounds,
const gfx::Display& display) {
// TODO: Use the 3rd parameter, |display|.
- aura::RootWindow* root = window->GetRootWindow();
+ aura::Window* root = window->GetRootWindow();
if (PositionWindowInScreenCoordinates(window)) {
// The caller expects windows we consider "embedded" to be placed in the
@@ -88,7 +88,7 @@ void DesktopScreenPositionClient::SetBounds(
DesktopNativeWidgetAura* desktop_native_widget =
DesktopNativeWidgetAura::ForWindow(window);
if (desktop_native_widget) {
- root->SetHostBounds(bounds);
+ root->GetDispatcher()->SetHostBounds(bounds);
// Setting bounds of root resizes |window|.
} else {
window->SetBounds(bounds);
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_win.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698