| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PANELS_PANEL_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/launcher/launcher_icon_observer.h" | 11 #include "ash/launcher/launcher_icon_observer.h" |
| 12 #include "ash/shell_observer.h" | 12 #include "ash/shell_observer.h" |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "ui/aura/client/activation_change_observer.h" | 17 #include "ui/aura/client/activation_change_observer.h" |
| 18 #include "ui/aura/layout_manager.h" | 18 #include "ui/aura/layout_manager.h" |
| 19 #include "ui/aura/window_observer.h" | 19 #include "ui/aura/window_observer.h" |
| 20 #include "ui/keyboard/keyboard_controller.h" |
| 20 | 21 |
| 21 namespace aura { | 22 namespace aura { |
| 22 class Window; | 23 class Window; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace gfx { | 26 namespace gfx { |
| 26 class Rect; | 27 class Rect; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace views { | 30 namespace views { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 43 // | 44 // |
| 44 // The constructor takes a |panel_container| argument which is expected to set | 45 // The constructor takes a |panel_container| argument which is expected to set |
| 45 // its layout manager to this instance, e.g.: | 46 // its layout manager to this instance, e.g.: |
| 46 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); | 47 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); |
| 47 | 48 |
| 48 class ASH_EXPORT PanelLayoutManager | 49 class ASH_EXPORT PanelLayoutManager |
| 49 : public aura::LayoutManager, | 50 : public aura::LayoutManager, |
| 50 public ash::LauncherIconObserver, | 51 public ash::LauncherIconObserver, |
| 51 public ash::ShellObserver, | 52 public ash::ShellObserver, |
| 52 public aura::WindowObserver, | 53 public aura::WindowObserver, |
| 53 public aura::client::ActivationChangeObserver { | 54 public aura::client::ActivationChangeObserver, |
| 55 public keyboard::KeyboardController::Observer { |
| 54 public: | 56 public: |
| 55 explicit PanelLayoutManager(aura::Window* panel_container); | 57 explicit PanelLayoutManager(aura::Window* panel_container); |
| 56 virtual ~PanelLayoutManager(); | 58 virtual ~PanelLayoutManager(); |
| 57 | 59 |
| 58 // Call Shutdown() before deleting children of panel_container. | 60 // Call Shutdown() before deleting children of panel_container. |
| 59 void Shutdown(); | 61 void Shutdown(); |
| 60 | 62 |
| 61 void StartDragging(aura::Window* panel); | 63 void StartDragging(aura::Window* panel); |
| 62 void FinishDragging(); | 64 void FinishDragging(); |
| 63 | 65 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Called whenever the panel layout might change. | 124 // Called whenever the panel layout might change. |
| 123 void Relayout(); | 125 void Relayout(); |
| 124 | 126 |
| 125 // Called whenever the panel stacking order needs to be updated (e.g. focus | 127 // Called whenever the panel stacking order needs to be updated (e.g. focus |
| 126 // changes or a panel is moved). | 128 // changes or a panel is moved). |
| 127 void UpdateStacking(aura::Window* active_panel); | 129 void UpdateStacking(aura::Window* active_panel); |
| 128 | 130 |
| 129 // Update the callout arrows for all managed panels. | 131 // Update the callout arrows for all managed panels. |
| 130 void UpdateCallouts(); | 132 void UpdateCallouts(); |
| 131 | 133 |
| 134 // Overridden from keyboard::KeyboardController::Observer: |
| 135 virtual void OnKeyboardBoundsChanged( |
| 136 const gfx::Rect& keyboard_bounds) OVERRIDE; |
| 137 |
| 132 // Parent window associated with this layout manager. | 138 // Parent window associated with this layout manager. |
| 133 aura::Window* panel_container_; | 139 aura::Window* panel_container_; |
| 134 // Protect against recursive calls to Relayout(). | 140 // Protect against recursive calls to Relayout(). |
| 135 bool in_layout_; | 141 bool in_layout_; |
| 136 // Ordered list of unowned pointers to panel windows. | 142 // Ordered list of unowned pointers to panel windows. |
| 137 PanelList panel_windows_; | 143 PanelList panel_windows_; |
| 138 // The panel being dragged. | 144 // The panel being dragged. |
| 139 aura::Window* dragged_panel_; | 145 aura::Window* dragged_panel_; |
| 140 // The launcher we are observing for launcher icon changes. | 146 // The launcher we are observing for launcher icon changes. |
| 141 Launcher* launcher_; | 147 Launcher* launcher_; |
| 142 // The last active panel. Used to maintain stacking even if no panels are | 148 // The last active panel. Used to maintain stacking even if no panels are |
| 143 // currently focused. | 149 // currently focused. |
| 144 aura::Window* last_active_panel_; | 150 aura::Window* last_active_panel_; |
| 145 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; | 151 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; |
| 146 | 152 |
| 147 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); | 153 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); |
| 148 }; | 154 }; |
| 149 | 155 |
| 150 } // namespace internal | 156 } // namespace internal |
| 151 } // namespace ash | 157 } // namespace ash |
| 152 | 158 |
| 153 #endif // ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ | 159 #endif // ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| OLD | NEW |