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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 19681003: Fix issue where window bounds were being passed with wrong coordinates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 8fbaad82ee016e1739ea068b586ac9b7a0ab1629..61aa218fde97d6ff2a0b46b667da573b7e579161 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -677,17 +677,7 @@ void RenderWidgetHostViewAura::InitAsPopup(
aura::RootWindow* root = popup_parent_host_view_->window_->GetRootWindow();
window_->SetDefaultParentByRootWindow(root, bounds_in_screen);
- // TODO(erg): While I could make sure details of the StackingClient are
- // hidden behind aura, hiding the details of the ScreenPositionClient will
- // take another effort.
- aura::client::ScreenPositionClient* screen_position_client =
- aura::client::GetScreenPositionClient(root);
- gfx::Point origin_in_parent(bounds_in_screen.origin());
- if (screen_position_client) {
- screen_position_client->ConvertPointFromScreen(
- window_->parent(), &origin_in_parent);
- }
- SetBounds(gfx::Rect(origin_in_parent, bounds_in_screen.size()));
+ SetBounds(bounds_in_screen);
Show();
}
@@ -763,11 +753,22 @@ void RenderWidgetHostViewAura::WasHidden() {
}
void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) {
- SetBounds(gfx::Rect(window_->bounds().origin(), size));
+ gfx::Rect bounds = window_->GetBoundsInScreen();
+ bounds.set_size(size);
+ SetBounds(bounds);
}
void RenderWidgetHostViewAura::SetBounds(const gfx::Rect& rect) {
- window_->SetBounds(rect);
+ aura::RootWindow* root_window = window_->GetRootWindow();
sky 2013/07/22 14:48:28 Please add a comment as to why this is necessary.
+ aura::client::ScreenPositionClient* screen_position_client =
+ aura::client::GetScreenPositionClient(root_window);
sky 2013/07/22 14:48:28 nit: indent 2 more.
+ gfx::Point origin_in_parent(rect.origin());
+ if (screen_position_client) {
+ screen_position_client->ConvertPointFromScreen(
+ window_->parent(), &origin_in_parent);
+ }
+
+ window_->SetBounds(gfx::Rect(origin_in_parent, rect.size()));
host_->WasResized();
MaybeCreateResizeLock();
if (touch_editing_client_) {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698