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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 10416017: Aura/ash split: Look for the ScreenPositionClient on the Window, not the RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 51b00ac539be3f533f8ca979212fae12a147bf11..75de8e5234f4c895c75ab6cc3008fdf3a7fa4b86 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -75,6 +75,16 @@ void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) {
window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds));
}
+void AdjustScreenBounds(aura::Window* window, gfx::Rect* bounds) {
+ aura::client::ScreenPositionClient* screen_position_client =
+ aura::client::GetScreenPositionClient(window);
+ if (screen_position_client) {
+ gfx::Point origin = bounds->origin();
+ screen_position_client->ConvertToScreenPoint(&origin);
+ bounds->set_origin(origin);
+ }
+}
+
} // namespace
// Used when SetInactiveRenderingDisabled() is invoked to track when active
@@ -420,15 +430,7 @@ void NativeWidgetAura::InitModalType(ui::ModalType modal_type) {
gfx::Rect NativeWidgetAura::GetWindowScreenBounds() const {
gfx::Rect bounds = window_->GetBoundsInRootWindow();
-
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(window_->GetRootWindow());
- if (screen_position_client) {
- gfx::Point origin = bounds.origin();
- screen_position_client->ConvertToScreenPoint(&origin);
- bounds.set_origin(origin);
- }
-
+ AdjustScreenBounds(window_, &bounds);
return bounds;
}
@@ -436,15 +438,7 @@ gfx::Rect NativeWidgetAura::GetClientAreaScreenBounds() const {
// View-to-screen coordinate system transformations depend on this returning
// the full window bounds, for example View::ConvertPointToScreen().
gfx::Rect bounds = window_->GetBoundsInRootWindow();
-
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(window_->GetRootWindow());
- if (screen_position_client) {
- gfx::Point origin = bounds.origin();
- screen_position_client->ConvertToScreenPoint(&origin);
- bounds.set_origin(origin);
- }
-
+ AdjustScreenBounds(window_, &bounds);
return bounds;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698