diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 16:40:06 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 16:40:06 +0000 |
commit | 8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80 (patch) | |
tree | 4fd429027e6fe44e79e8395ae63d6542d7edf657 /content/browser/renderer_host/render_widget_host_view_aura.cc | |
parent | 87cc09add3a1a9ef94aaec1865fc3aaa23720aaa (diff) | |
download | chromium_src-8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80.zip chromium_src-8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80.tar.gz chromium_src-8d625fbd16a1d20f5e34bd01b83b0402bd3b4c80.tar.bz2 |
* Use Virtual Screen Coordinates in more places
- When setting widget bounds.
- Workspace Manager
- When resizing
- Restore bounds
* Refactored ScreenPositionClient to manage Screen coordinates for different configurations.
* Renamed GetBounds/SetBounds methods to GetScreen/ParentBounds to make it clear that in which coordinates you're dealing with.
* I used InScreen/InParent for RestoreBounds because RestoreParent/ScreenBounds sounds strange.
Converted Linux/Aura to use ScreenPositionClient.
BUG=123160
TEST=several tests are updated to match VSC. added screen_ash_unittests. I'll update rest of tests when this is enable by default.
Review URL: https://chromiumcodereview.appspot.com/10696023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_widget_host_view_aura.cc')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 13 |
1 files changed, 6 insertions, 7 deletions
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 fd78b6f..fa120ca 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -26,6 +26,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/tooltip_client.h" #include "ui/aura/client/window_types.h" #include "ui/aura/cursor_manager.h" @@ -338,7 +339,7 @@ bool RenderWidgetHostViewAura::IsShowing() { } gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { - return window_->GetBoundsInRootWindow(); + return window_->GetRootWindowBounds(); } void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { @@ -842,12 +843,10 @@ gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(const gfx::Rect& rect) { gfx::Point end = gfx::Point(rect.right(), rect.bottom()); aura::RootWindow* root_window = window_->GetRootWindow(); - aura::Window::ConvertPointToWindow(window_, root_window, &origin); - aura::Window::ConvertPointToWindow(window_, root_window, &end); - // TODO(yusukes): Unlike Chrome OS, |root_window| origin might not be the - // same as the system screen origin on Windows and Linux. Probably we should - // (implement and) use something like ConvertPointToScreen(). - + aura::client::ScreenPositionClient* screen_position_client = + aura::client::GetScreenPositionClient(root_window); + screen_position_client->ConvertPointToScreen(window_, &origin); + screen_position_client->ConvertPointToScreen(window_, &end); return gfx::Rect(origin.x(), origin.y(), end.x() - origin.x(), |