| 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_WM_LOCK_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_LOCK_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_LOCK_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_LOCK_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
| 10 #include "ash/wm/wm_snap_to_pixel_layout_manager.h" | 10 #include "ash/wm/wm_snap_to_pixel_layout_manager.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // overscroll is enabled then work area always equals to display area size since | 32 // overscroll is enabled then work area always equals to display area size since |
| 33 // virtual keyboard changes inner workspace of each WebContents. | 33 // virtual keyboard changes inner workspace of each WebContents. |
| 34 // For all windows in LockScreenContainer default wm::WindowState is replaced | 34 // For all windows in LockScreenContainer default wm::WindowState is replaced |
| 35 // with LockWindowState. | 35 // with LockWindowState. |
| 36 class ASH_EXPORT LockLayoutManager | 36 class ASH_EXPORT LockLayoutManager |
| 37 : public wm::WmSnapToPixelLayoutManager, | 37 : public wm::WmSnapToPixelLayoutManager, |
| 38 public aura::WindowObserver, | 38 public aura::WindowObserver, |
| 39 public ShellObserver, | 39 public ShellObserver, |
| 40 public keyboard::KeyboardControllerObserver { | 40 public keyboard::KeyboardControllerObserver { |
| 41 public: | 41 public: |
| 42 explicit LockLayoutManager(WmWindow* window); | 42 explicit LockLayoutManager(aura::Window* window); |
| 43 ~LockLayoutManager() override; | 43 ~LockLayoutManager() override; |
| 44 | 44 |
| 45 // Overridden from WmSnapToPixelLayoutManager: | 45 // Overridden from WmSnapToPixelLayoutManager: |
| 46 void OnWindowResized() override; | 46 void OnWindowResized() override; |
| 47 void OnWindowAddedToLayout(WmWindow* child) override; | 47 void OnWindowAddedToLayout(aura::Window* child) override; |
| 48 void OnWillRemoveWindowFromLayout(WmWindow* child) override; | 48 void OnWillRemoveWindowFromLayout(aura::Window* child) override; |
| 49 void OnWindowRemovedFromLayout(WmWindow* child) override; | 49 void OnWindowRemovedFromLayout(aura::Window* child) override; |
| 50 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; | 50 void OnChildWindowVisibilityChanged(aura::Window* child, |
| 51 void SetChildBounds(WmWindow* child, | 51 bool visibile) override; |
| 52 void SetChildBounds(aura::Window* child, |
| 52 const gfx::Rect& requested_bounds) override; | 53 const gfx::Rect& requested_bounds) override; |
| 53 | 54 |
| 54 // Overriden from aura::WindowObserver: | 55 // Overriden from aura::WindowObserver: |
| 55 void OnWindowDestroying(aura::Window* window) override; | 56 void OnWindowDestroying(aura::Window* window) override; |
| 56 void OnWindowBoundsChanged(aura::Window* window, | 57 void OnWindowBoundsChanged(aura::Window* window, |
| 57 const gfx::Rect& old_bounds, | 58 const gfx::Rect& old_bounds, |
| 58 const gfx::Rect& new_bounds) override; | 59 const gfx::Rect& new_bounds) override; |
| 59 | 60 |
| 60 // ShellObserver: | 61 // ShellObserver: |
| 61 void OnVirtualKeyboardStateChanged(bool activated, | 62 void OnVirtualKeyboardStateChanged(bool activated, |
| 62 WmWindow* root_window) override; | 63 aura::Window* root_window) override; |
| 63 | 64 |
| 64 // keyboard::KeyboardControllerObserver overrides: | 65 // keyboard::KeyboardControllerObserver overrides: |
| 65 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 66 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
| 66 void OnKeyboardClosed() override; | 67 void OnKeyboardClosed() override; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 // Adjusts the bounds of all managed windows when the display area changes. | 70 // Adjusts the bounds of all managed windows when the display area changes. |
| 70 // This happens when the display size, work area insets has changed. | 71 // This happens when the display size, work area insets has changed. |
| 71 void AdjustWindowsForWorkAreaChange(const wm::WMEvent* event); | 72 void AdjustWindowsForWorkAreaChange(const wm::WMEvent* event); |
| 72 | 73 |
| 73 WmWindow* window_; | 74 aura::Window* window_; |
| 74 WmWindow* root_window_; | 75 aura::Window* root_window_; |
| 75 | 76 |
| 76 ScopedObserver<keyboard::KeyboardController, | 77 ScopedObserver<keyboard::KeyboardController, |
| 77 keyboard::KeyboardControllerObserver> | 78 keyboard::KeyboardControllerObserver> |
| 78 keyboard_observer_; | 79 keyboard_observer_; |
| 79 | 80 |
| 80 // The bounds of the keyboard. | 81 // The bounds of the keyboard. |
| 81 gfx::Rect keyboard_bounds_; | 82 gfx::Rect keyboard_bounds_; |
| 82 | 83 |
| 83 DISALLOW_COPY_AND_ASSIGN(LockLayoutManager); | 84 DISALLOW_COPY_AND_ASSIGN(LockLayoutManager); |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace ash | 87 } // namespace ash |
| 87 | 88 |
| 88 #endif // ASH_WM_LOCK_LAYOUT_MANAGER_H_ | 89 #endif // ASH_WM_LOCK_LAYOUT_MANAGER_H_ |
| OLD | NEW |