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 /ash/shell.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 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index b017668..681425c 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -20,6 +20,7 @@ #include "ash/display/display_controller.h" #include "ash/display/mouse_cursor_event_filter.h" #include "ash/display/multi_display_manager.h" +#include "ash/display/screen_position_controller.h" #include "ash/display/secondary_display_view.h" #include "ash/root_window_controller.h" #include "ash/screen_ash.h" @@ -249,6 +250,7 @@ Shell::~Shell() { // This also deletes all RootWindows. display_controller_.reset(); + screen_position_controller_.reset(); // Launcher widget has a InputMethodBridge that references to // input_method_filter_'s input_method_. So explicitly release launcher_ @@ -357,6 +359,8 @@ std::vector<aura::Window*> Shell::GetAllContainers(int container_id) { } void Shell::Init() { + if (internal::DisplayController::IsVirtualScreenCoordinatesEnabled()) + VLOG(1) << "Using virtual screen coordinates"; // Install the custom factory first so that views::FocusManagers for Tray, // Launcher, and WallPaper could be created by the factory. views::FocusManagerFactory::Install(new AshFocusManagerFactory); @@ -372,6 +376,7 @@ void Shell::Init() { activation_controller_.reset( new internal::ActivationController(focus_manager_.get())); + screen_position_controller_.reset(new internal::ScreenPositionController); display_controller_.reset(new internal::DisplayController); display_controller_->InitPrimaryDisplay(); aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); @@ -678,6 +683,8 @@ void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { root->layout_manager()->OnWindowResized(); root->ShowRootWindow(); aura::client::SetCaptureClient(root, capture_controller_.get()); + aura::client::SetScreenPositionClient( + root, screen_position_controller_.get()); } } @@ -695,6 +702,8 @@ void Shell::InitRootWindowController( aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); aura::client::SetCaptureClient(root_window, capture_controller_.get()); + aura::client::SetScreenPositionClient(root_window, + screen_position_controller_.get()); if (nested_dispatcher_controller_.get()) { aura::client::SetDispatcherClient(root_window, |