| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ |
| 6 #define ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ | 6 #define ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/shell_observer.h" | 9 #include "ash/common/shell_observer.h" |
| 10 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" | 10 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" |
| 11 #include "ash/common/wm/wm_types.h" | 11 #include "ash/common/wm/wm_types.h" |
| 12 #include "ash/common/wm_window_observer.h" | |
| 13 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/aura/window_observer.h" |
| 14 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/keyboard/keyboard_controller.h" | 15 #include "ui/keyboard/keyboard_controller.h" |
| 16 #include "ui/keyboard/keyboard_controller_observer.h" | 16 #include "ui/keyboard/keyboard_controller_observer.h" |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace wm { | 19 namespace wm { |
| 20 class WindowState; | 20 class WindowState; |
| 21 class WMEvent; | 21 class WMEvent; |
| 22 } | 22 } |
| 23 | 23 |
| 24 // LockLayoutManager is used for the windows created in LockScreenContainer. | 24 // LockLayoutManager is used for the windows created in LockScreenContainer. |
| 25 // For Chrome OS this includes out-of-box/login/lock/multi-profile login use | 25 // For Chrome OS this includes out-of-box/login/lock/multi-profile login use |
| 26 // cases. LockScreenContainer does not use default work area definition. | 26 // cases. LockScreenContainer does not use default work area definition. |
| 27 // By default work area is defined as display area minus shelf, docked windows | 27 // By default work area is defined as display area minus shelf, docked windows |
| 28 // and minus virtual keyboard bounds. | 28 // and minus virtual keyboard bounds. |
| 29 // For windows in LockScreenContainer work area is display area minus virtual | 29 // For windows in LockScreenContainer work area is display area minus virtual |
| 30 // keyboard bounds (only if keyboard overscroll is disabled). If keyboard | 30 // keyboard bounds (only if keyboard overscroll is disabled). If keyboard |
| 31 // overscroll is enabled then work area always equals to display area size since | 31 // overscroll is enabled then work area always equals to display area size since |
| 32 // virtual keyboard changes inner workspace of each WebContents. | 32 // virtual keyboard changes inner workspace of each WebContents. |
| 33 // For all windows in LockScreenContainer default wm::WindowState is replaced | 33 // For all windows in LockScreenContainer default wm::WindowState is replaced |
| 34 // with LockWindowState. | 34 // with LockWindowState. |
| 35 class ASH_EXPORT LockLayoutManager | 35 class ASH_EXPORT LockLayoutManager |
| 36 : public wm::WmSnapToPixelLayoutManager, | 36 : public wm::WmSnapToPixelLayoutManager, |
| 37 public WmWindowObserver, | 37 public aura::WindowObserver, |
| 38 public ShellObserver, | 38 public ShellObserver, |
| 39 public keyboard::KeyboardControllerObserver { | 39 public keyboard::KeyboardControllerObserver { |
| 40 public: | 40 public: |
| 41 explicit LockLayoutManager(WmWindow* window); | 41 explicit LockLayoutManager(WmWindow* window); |
| 42 ~LockLayoutManager() override; | 42 ~LockLayoutManager() override; |
| 43 | 43 |
| 44 // Overridden from WmSnapToPixelLayoutManager: | 44 // Overridden from WmSnapToPixelLayoutManager: |
| 45 void OnWindowResized() override; | 45 void OnWindowResized() override; |
| 46 void OnWindowAddedToLayout(WmWindow* child) override; | 46 void OnWindowAddedToLayout(WmWindow* child) override; |
| 47 void OnWillRemoveWindowFromLayout(WmWindow* child) override; | 47 void OnWillRemoveWindowFromLayout(WmWindow* child) override; |
| 48 void OnWindowRemovedFromLayout(WmWindow* child) override; | 48 void OnWindowRemovedFromLayout(WmWindow* child) override; |
| 49 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; | 49 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; |
| 50 void SetChildBounds(WmWindow* child, | 50 void SetChildBounds(WmWindow* child, |
| 51 const gfx::Rect& requested_bounds) override; | 51 const gfx::Rect& requested_bounds) override; |
| 52 | 52 |
| 53 // Overriden from WmWindowObserver: | 53 // Overriden from aura::WindowObserver: |
| 54 void OnWindowDestroying(WmWindow* window) override; | 54 void OnWindowDestroying(aura::Window* window) override; |
| 55 void OnWindowBoundsChanged(WmWindow* window, | 55 void OnWindowBoundsChanged(aura::Window* window, |
| 56 const gfx::Rect& old_bounds, | 56 const gfx::Rect& old_bounds, |
| 57 const gfx::Rect& new_bounds) override; | 57 const gfx::Rect& new_bounds) override; |
| 58 | 58 |
| 59 // ShellObserver: | 59 // ShellObserver: |
| 60 void OnVirtualKeyboardStateChanged(bool activated) override; | 60 void OnVirtualKeyboardStateChanged(bool activated) override; |
| 61 | 61 |
| 62 // keyboard::KeyboardControllerObserver overrides: | 62 // keyboard::KeyboardControllerObserver overrides: |
| 63 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 63 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
| 64 void OnKeyboardClosed() override; | 64 void OnKeyboardClosed() override; |
| 65 | 65 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 76 | 76 |
| 77 // The bounds of the keyboard. | 77 // The bounds of the keyboard. |
| 78 gfx::Rect keyboard_bounds_; | 78 gfx::Rect keyboard_bounds_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(LockLayoutManager); | 80 DISALLOW_COPY_AND_ASSIGN(LockLayoutManager); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace ash | 83 } // namespace ash |
| 84 | 84 |
| 85 #endif // ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ | 85 #endif // ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ |
| OLD | NEW |