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

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

Issue 10210005: Ash/aura split: NativeWidgetAura::GetWindowScreenBounds() should return screen bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sky+oshima stuff Created 8 years, 8 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 202caa8ac1914ad8683cc722cd1be5f75923ac3d..0b10f0abdb3df0cf62884cd446e9cd3150f9f285 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -349,7 +349,7 @@ InputMethod* NativeWidgetAura::CreateInputMethod() {
}
void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
- gfx::Rect parent_bounds(window_->parent()->GetScreenBounds());
+ gfx::Rect parent_bounds(window_->parent()->GetBoundsInRootWindow());
// When centering window, we take the intersection of the host and
// the parent. We assume the root window represents the visible
// rect of a single screen.
@@ -360,7 +360,7 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
// center it with respect to the transient parent.
if (window_->transient_parent()) {
gfx::Rect transient_parent_rect = window_->transient_parent()->
- GetScreenBounds().Intersect(work_area);
+ GetBoundsInRootWindow().Intersect(work_area);
if (transient_parent_rect.height() >= size.height() &&
transient_parent_rect.width() >= size.width())
parent_bounds = transient_parent_rect;
@@ -420,9 +420,12 @@ void NativeWidgetAura::InitModalType(ui::ModalType modal_type) {
gfx::Rect NativeWidgetAura::GetWindowScreenBounds() const {
#if defined(ENABLE_DIP)
- return ConvertRectFromMonitor(window_->GetScreenBounds());
+ return ConvertRectFromMonitor(window_->GetBoundsInRootWindow());
#else
- return window_->GetScreenBounds();
+ gfx::Rect bounds = window_->GetBoundsInRootWindow();
+ if (desktop_helper_.get())
+ bounds = desktop_helper_->ChangeRootWindowBoundsToScreenBounds(bounds);
+ return bounds;
#endif
}
@@ -430,9 +433,12 @@ gfx::Rect NativeWidgetAura::GetClientAreaScreenBounds() const {
// View-to-screen coordinate system transformations depend on this returning
// the full window bounds, for example View::ConvertPointToScreen().
#if defined(ENABLE_DIP)
- return ConvertRectFromMonitor(window_->GetScreenBounds());
+ return ConvertRectFromMonitor(window_->GetBoundsInRootWindow());
#else
- return window_->GetScreenBounds();
+ gfx::Rect bounds = window_->GetBoundsInRootWindow();
+ if (desktop_helper_.get())
+ bounds = desktop_helper_->ChangeRootWindowBoundsToScreenBounds(bounds);
+ return bounds;
#endif
}
« 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