diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-12 22:56:25 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-12 22:56:25 +0000 |
commit | 04925978d28ec771c89fb9fab52b89e592d68f20 (patch) | |
tree | 5c287ae2a6243ea108f12aaeb1b675a17dd14183 /ash | |
parent | b400c9082d1efdd734a92d906f2a0c9d80f70aa8 (diff) | |
download | chromium_src-04925978d28ec771c89fb9fab52b89e592d68f20.zip chromium_src-04925978d28ec771c89fb9fab52b89e592d68f20.tar.gz chromium_src-04925978d28ec771c89fb9fab52b89e592d68f20.tar.bz2 |
Revert 167245 - Currently, the ash and desktop implementations of StackingClient stomp each other in aura::Env. Instead:
- Don't have StackingClient implementations install themselves by default
- Add chrome implementation of StackingClient that dispatches to ash or desktop
- Pass extra |context| to GetDefaultParent (normally a RootWindow) that it can use to determine desktop type.
- Workaround a few locations by using ScopedForceDesktopType: in these locations, the GetHostDesktopForNative... functions fail because they're used during window creation when the windows have no parent (and so can't determine which desktop they're in).
- Remove window-specific StackingClient (unnecessary?)
BUG=128578
Review URL: https://codereview.chromium.org/11364053
TBR=scottmg@google.com
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/shell.cc | 9 | ||||
-rw-r--r-- | ash/shell.h | 6 | ||||
-rw-r--r-- | ash/shell/shell_delegate_impl.cc | 4 | ||||
-rw-r--r-- | ash/shell/shell_delegate_impl.h | 1 | ||||
-rw-r--r-- | ash/shell_delegate.h | 4 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.cc | 5 | ||||
-rw-r--r-- | ash/test/test_shell_delegate.h | 1 | ||||
-rw-r--r-- | ash/wm/stacking_controller.cc | 8 | ||||
-rw-r--r-- | ash/wm/stacking_controller.h | 10 |
9 files changed, 12 insertions, 36 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index 3a94294..579bd76 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -66,7 +66,6 @@ #include "base/command_line.h" #include "base/debug/leak_annotations.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/client/stacking_client.h" #include "ui/aura/client/user_action_client.h" #include "ui/aura/display_manager.h" #include "ui/aura/env.h" @@ -455,9 +454,7 @@ void Shell::Init() { // Create Controllers that may need root window. // TODO(oshima): Move as many controllers before creating // RootWindowController as possible. - stacking_client_.reset(delegate_->CreateStackingClient()); - if (stacking_client_.get()) - aura::client::SetStackingClient(stacking_client_.get()); + stacking_controller_.reset(new internal::StackingController); visibility_controller_.reset(new internal::VisibilityController); drag_drop_controller_.reset(new internal::DragDropController); user_action_client_.reset(delegate_->CreateUserActionClient()); @@ -774,10 +771,6 @@ void Shell::DoInitialWorkspaceAnimation() { DoInitialAnimation(); } -aura::client::StackingClient* Shell::stacking_client() { - return stacking_client_.get(); -} - void Shell::InitRootWindowController( internal::RootWindowController* controller) { aura::RootWindow* root_window = controller->root_window(); diff --git a/ash/shell.h b/ash/shell.h index ad24bc5..d25998e 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -31,7 +31,6 @@ class FocusManager; class RootWindow; class Window; namespace client { -class StackingClient; class UserActionClient; } } @@ -100,6 +99,7 @@ class RootWindowLayoutManager; class ScreenPositionController; class ShadowController; class SlowAnimationEventFilter; +class StackingController; class StatusAreaWidget; class SystemGestureEventFilter; class SystemModalContainerEventFilter; @@ -410,8 +410,6 @@ class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate, } #endif // defined(OS_CHROMEOS) - aura::client::StackingClient* stacking_client(); - private: FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor); FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors); @@ -470,7 +468,7 @@ class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate, scoped_ptr<internal::AppListController> app_list_controller_; - scoped_ptr<aura::client::StackingClient> stacking_client_; + scoped_ptr<internal::StackingController> stacking_controller_; scoped_ptr<internal::ActivationController> activation_controller_; scoped_ptr<internal::CaptureController> capture_controller_; scoped_ptr<internal::WindowModalityController> window_modality_controller_; diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc index 206a476..380af07 100644 --- a/ash/shell/shell_delegate_impl.cc +++ b/ash/shell/shell_delegate_impl.cc @@ -173,9 +173,5 @@ ui::MenuModel* ShellDelegateImpl::CreateContextMenu(aura::RootWindow* root) { return new ContextMenu(root); } -aura::client::StackingClient* ShellDelegateImpl::CreateStackingClient() { - return NULL; -} - } // namespace shell } // namespace ash diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h index 6f55237..987c7af 100644 --- a/ash/shell/shell_delegate_impl.h +++ b/ash/shell/shell_delegate_impl.h @@ -59,7 +59,6 @@ class ShellDelegateImpl : public ash::ShellDelegate { virtual double GetSavedScreenMagnifierScale() OVERRIDE; virtual ui::MenuModel* CreateContextMenu( aura::RootWindow* root_window) OVERRIDE; - virtual aura::client::StackingClient* CreateStackingClient() OVERRIDE; private: // Used to update Launcher. Owned by main. diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index 6f3c7f3..5f69459 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h @@ -21,7 +21,6 @@ namespace aura { class RootWindow; class Window; namespace client { -class StackingClient; class UserActionClient; } } @@ -182,9 +181,6 @@ class ASH_EXPORT ShellDelegate { // Creates a menu model of the context for the |root_window|. virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root_window) = 0; - - // Creates the stacking client. Shell takes ownership of the object. - virtual aura::client::StackingClient* CreateStackingClient() = 0; }; } // namespace ash diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index c165707..8575d6b 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -10,7 +10,6 @@ #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/test_launcher_delegate.h" -#include "ash/wm/stacking_controller.h" #include "ash/wm/window_util.h" #include "content/public/test/test_browser_context.h" #include "ui/aura/window.h" @@ -160,9 +159,5 @@ double TestShellDelegate::GetSavedScreenMagnifierScale() { return std::numeric_limits<double>::min(); } -aura::client::StackingClient* TestShellDelegate::CreateStackingClient() { - return new StackingController; -} - } // namespace test } // namespace ash diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index a1e9747..76b48b1 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -55,7 +55,6 @@ class TestShellDelegate : public ShellDelegate { virtual void SaveScreenMagnifierScale(double scale) OVERRIDE; virtual double GetSavedScreenMagnifierScale() OVERRIDE; virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root) OVERRIDE; - virtual aura::client::StackingClient* CreateStackingClient() OVERRIDE; int num_exit_requests() const { return num_exit_requests_; } private: diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc index a5517d1..f5b2c06 100644 --- a/ash/wm/stacking_controller.cc +++ b/ash/wm/stacking_controller.cc @@ -17,6 +17,7 @@ #include "ui/base/ui_base_types.h" namespace ash { +namespace internal { namespace { // Find a root window that matches the |bounds|. If the virtual screen @@ -55,6 +56,7 @@ bool IsWindowModal(aura::Window* window) { // StackingController, public: StackingController::StackingController() { + aura::client::SetStackingClient(this); } StackingController::~StackingController() { @@ -63,8 +65,7 @@ StackingController::~StackingController() { //////////////////////////////////////////////////////////////////////////////// // StackingController, aura::StackingClient implementation: -aura::Window* StackingController::GetDefaultParent(aura::Window* context, - aura::Window* window, +aura::Window* StackingController::GetDefaultParent(aura::Window* window, const gfx::Rect& bounds) { aura::RootWindow* target_root = NULL; if (window->transient_parent()) { @@ -147,9 +148,10 @@ StackingController::GetAlwaysOnTopController(aura::RootWindow* root_window) { root_window->GetChildById( internal::kShellWindowId_AlwaysOnTopContainer)); // RootWindow owns the AlwaysOnTopController object. - root_window->SetProperty(internal::kAlwaysOnTopControllerKey, controller); + root_window->SetProperty(kAlwaysOnTopControllerKey, controller); } return controller; } +} // namespace internal } // namespace ash diff --git a/ash/wm/stacking_controller.h b/ash/wm/stacking_controller.h index 21611ed..ae90555 100644 --- a/ash/wm/stacking_controller.h +++ b/ash/wm/stacking_controller.h @@ -5,7 +5,6 @@ #ifndef ASH_WM_STACKING_CONTROLLER_H_ #define ASH_WM_STACKING_CONTROLLER_H_ -#include "ash/ash_export.h" #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" @@ -16,19 +15,17 @@ class RootWindow; } namespace ash { - namespace internal { + class AlwaysOnTopController; -} -class ASH_EXPORT StackingController : public aura::client::StackingClient { +class StackingController : public aura::client::StackingClient { public: StackingController(); virtual ~StackingController(); // Overridden from aura::client::StackingClient: - virtual aura::Window* GetDefaultParent(aura::Window* context, - aura::Window* window, + virtual aura::Window* GetDefaultParent(aura::Window* window, const gfx::Rect& bounds) OVERRIDE; private: @@ -47,6 +44,7 @@ class ASH_EXPORT StackingController : public aura::client::StackingClient { DISALLOW_COPY_AND_ASSIGN(StackingController); }; +} // namespace internal } // namespace ash #endif // ASH_WM_STACKING_CONTROLLER_H_ |