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

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

Issue 10409011: Aura/ash: On Desktops, use a aura::client to resolve screen coordinates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge with trunk. 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 | « ui/views/widget/desktop_native_widget_helper_aura.cc ('k') | ui/views/widget/native_widget_helper_aura.h » ('j') | 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 a71b3d7b1335aa492952e285fbf9489da33dbf8a..5fb9e7de72a98f8830e7dec47255985ae58bc779 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -10,6 +10,7 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/drag_drop_client.h"
+#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/client/window_move_client.h"
#include "ui/aura/client/window_types.h"
#include "ui/aura/env.h"
@@ -169,7 +170,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
ownership_ = params.ownership;
if (desktop_helper_.get())
- desktop_helper_->PreInitialize(params);
+ desktop_helper_->PreInitialize(window_, params);
window_->set_user_data(this);
window_->SetType(GetAuraWindowTypeForWidgetType(params.type));
@@ -419,8 +420,15 @@ void NativeWidgetAura::InitModalType(ui::ModalType modal_type) {
gfx::Rect NativeWidgetAura::GetWindowScreenBounds() const {
gfx::Rect bounds = window_->GetBoundsInRootWindow();
- if (desktop_helper_.get())
- bounds = desktop_helper_->ChangeRootWindowBoundsToScreenBounds(bounds);
+
+ 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);
+ }
+
return bounds;
}
@@ -428,8 +436,15 @@ 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();
- if (desktop_helper_.get())
- bounds = desktop_helper_->ChangeRootWindowBoundsToScreenBounds(bounds);
+
+ 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);
+ }
+
return bounds;
}
« no previous file with comments | « ui/views/widget/desktop_native_widget_helper_aura.cc ('k') | ui/views/widget/native_widget_helper_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698