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

Unified Diff: ash/display/screen_position_controller.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First cut for review/trybots 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: ash/display/screen_position_controller.cc
diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc
index 3713b78a1774e879c3615e336c15ffb56fb9581c..0e92e04b26f92b869fe3e64e8885a8a7c1dff2c4 100644
--- a/ash/display/screen_position_controller.cc
+++ b/ash/display/screen_position_controller.cc
@@ -35,7 +35,7 @@ bool ShouldStayInSameRootWindow(const aura::Window* window) {
// the child windows and transient children of the transient children.
void MoveAllTransientChildrenToNewRoot(const gfx::Display& display,
aura::Window* window) {
- aura::RootWindow* dst_root = Shell::GetInstance()->display_controller()->
+ aura::Window* dst_root = Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display.id());
aura::Window::Windows transient_children = window->transient_children();
for (aura::Window::Windows::iterator iter = transient_children.begin();
@@ -66,7 +66,7 @@ void MoveAllTransientChildrenToNewRoot(const gfx::Display& display,
std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
aura::Window* window,
const gfx::Point& location) {
- aura::RootWindow* root_window = window->GetRootWindow();
+ aura::Window* root_window = window->GetRootWindow();
gfx::Point location_in_root(location);
aura::Window::ConvertPointToTarget(window, root_window, &location_in_root);
@@ -108,7 +108,7 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
// TODO(yusukes): Support non-X11 platforms if necessary.
#endif
- return std::make_pair(root_window, location_in_root);
+ return std::make_pair(root_window->GetDispatcher(), location_in_root);
}
} // namespace
@@ -118,19 +118,19 @@ namespace internal {
void ScreenPositionController::ConvertPointToScreen(
const aura::Window* window,
gfx::Point* point) {
- const aura::RootWindow* root = window->GetRootWindow();
+ const aura::Window* root = window->GetRootWindow();
aura::Window::ConvertPointToTarget(window, root, point);
const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- const_cast<aura::RootWindow*>(root)).bounds().origin();
+ const_cast<aura::Window*>(root)).bounds().origin();
point->Offset(display_origin.x(), display_origin.y());
}
void ScreenPositionController::ConvertPointFromScreen(
const aura::Window* window,
gfx::Point* point) {
- const aura::RootWindow* root = window->GetRootWindow();
+ const aura::Window* root = window->GetRootWindow();
const gfx::Point display_origin = Shell::GetScreen()->GetDisplayNearestWindow(
- const_cast<aura::RootWindow*>(root)).bounds().origin();
+ const_cast<aura::Window*>(root)).bounds().origin();
point->Offset(-display_origin.x(), -display_origin.y());
aura::Window::ConvertPointToTarget(root, window, point);
}
@@ -138,8 +138,8 @@ void ScreenPositionController::ConvertPointFromScreen(
void ScreenPositionController::ConvertHostPointToScreen(
aura::Window* root_window,
gfx::Point* point) {
- aura::RootWindow* root = root_window->GetRootWindow();
- root->ConvertPointFromHost(point);
+ aura::Window* root = root_window->GetRootWindow();
+ root->GetDispatcher()->ConvertPointFromHost(point);
std::pair<aura::RootWindow*, gfx::Point> pair =
GetRootWindowRelativeToWindow(root, *point);
*point = pair.second;
@@ -163,7 +163,7 @@ void ScreenPositionController::SetBounds(aura::Window* window,
// outside of the display.
if (!window->transient_parent() &&
!ShouldStayInSameRootWindow(window)) {
- aura::RootWindow* dst_root =
+ aura::Window* dst_root =
Shell::GetInstance()->display_controller()->GetRootWindowForDisplayId(
display.id());
DCHECK(dst_root);
@@ -197,8 +197,9 @@ void ScreenPositionController::SetBounds(aura::Window* window,
// Restore focused/active window.
if (tracker.Contains(focused)) {
aura::client::GetFocusClient(window)->FocusWindow(focused);
+ // TODO(beng): replace with GetRootWindow().
ash::Shell::GetInstance()->set_target_root_window(
- focused->GetRootWindow());
+ focused->GetDispatcher());
} else if (tracker.Contains(active)) {
activation_client->ActivateWindow(active);
}

Powered by Google App Engine
This is Rietveld 408576698