Chromium Code Reviews| Index: ash/root_window_controller.cc |
| diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
| index 578fdece3beb57ff81167845ed77a02b2d01cadc..ae356147d59bab3016a7e838cbf25b265c54c7a5 100644 |
| --- a/ash/root_window_controller.cc |
| +++ b/ash/root_window_controller.cc |
| @@ -48,7 +48,9 @@ |
| #include "ui/aura/client/tooltip_client.h" |
| #include "ui/aura/root_window.h" |
| #include "ui/aura/window.h" |
| +#include "ui/aura/window_delegate.h" |
| #include "ui/aura/window_observer.h" |
| +#include "ui/base/hit_test.h" |
| #include "ui/base/models/menu_model.h" |
| #include "ui/gfx/screen.h" |
| #include "ui/keyboard/keyboard_controller.h" |
| @@ -164,6 +166,60 @@ void DescendantShouldStayInSameRootWindow(aura::Window* container) { |
| container->SetProperty(internal::kStayInSameRootWindowKey, true); |
| } |
| +class EmptyWindowDelegate : public aura::WindowDelegate { |
|
Daniel Erat
2013/08/02 15:40:26
add a comment describing what this class is/does
|
| + public: |
| + EmptyWindowDelegate() {} |
| + virtual ~EmptyWindowDelegate() {} |
| + |
| + // aura::WindowDelegate overrides: |
| + virtual gfx::Size GetMinimumSize() const OVERRIDE { |
| + return gfx::Size(); |
| + } |
| + virtual gfx::Size GetMaximumSize() const OVERRIDE { |
| + return gfx::Size(); |
| + } |
| + virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| + const gfx::Rect& new_bounds) OVERRIDE { |
| + } |
| + virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE { |
| + return gfx::kNullCursor; |
| + } |
| + virtual int GetNonClientComponent( |
| + const gfx::Point& point) const OVERRIDE { |
| + return HTNOWHERE; |
| + } |
| + virtual bool ShouldDescendIntoChildForEventHandling( |
| + aura::Window* child, |
| + const gfx::Point& location) OVERRIDE { |
| + return false; |
| + } |
| + virtual bool CanFocus() OVERRIDE { |
| + return false; |
| + } |
| + virtual void OnCaptureLost() OVERRIDE { |
| + } |
| + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
| + } |
| + virtual void OnDeviceScaleFactorChanged( |
| + float device_scale_factor) OVERRIDE { |
| + } |
| + virtual void OnWindowDestroying() OVERRIDE {} |
| + virtual void OnWindowDestroyed() OVERRIDE {} |
| + virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE { |
| + } |
| + virtual bool HasHitTestMask() const OVERRIDE { |
| + return false; |
| + } |
| + virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {} |
| + virtual scoped_refptr<ui::Texture> CopyTexture() OVERRIDE { |
| + NOTREACHED(); |
| + return scoped_refptr<ui::Texture>(); |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(EmptyWindowDelegate); |
| +}; |
| + |
| } // namespace |
| namespace internal { |
| @@ -339,6 +395,8 @@ void RootWindowController::OnWallpaperAnimationFinished(views::Widget* widget) { |
| } |
| void RootWindowController::CloseChildWindows() { |
| + mouse_event_target_.reset(); |
| + |
| if (!shelf_.get()) |
| return; |
| // panel_layout_manager_ needs to be shut down before windows are destroyed. |
| @@ -483,6 +541,16 @@ void RootWindowController::InitLayoutManagers() { |
| shelf_.reset(new ShelfWidget( |
| shelf_container, status_container, workspace_controller())); |
| + // This window exists only to be a event target on login screen. |
| + // It does not have to handle events, nor be visible. |
| + mouse_event_target_.reset(new aura::Window(new EmptyWindowDelegate)); |
| + mouse_event_target_->Init(ui::LAYER_NOT_DRAWN); |
| + |
| + aura::Window* lock_background_container = |
| + GetContainer(internal::kShellWindowId_LockScreenBackgroundContainer); |
| + lock_background_container->AddChild(mouse_event_target_.get()); |
| + mouse_event_target_->Show(); |
| + |
| // Create Docked windows layout manager |
| aura::Window* docked_container = GetContainer( |
| internal::kShellWindowId_DockedContainer); |
| @@ -710,6 +778,8 @@ void RootWindowController::DisableTouchHudProjection() { |
| } |
| void RootWindowController::OnLoginStateChanged(user::LoginStatus status) { |
| + if (status != user::LOGGED_IN_NONE) |
| + mouse_event_target_.reset(); |
| shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
| } |