| 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/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shell_observer.h" | 13 #include "ash/shell_observer.h" |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "ui/aura/client/activation_change_observer.h" | 18 #include "ui/aura/client/activation_change_observer.h" |
| 19 #include "ui/aura/layout_manager.h" | 19 #include "ui/aura/layout_manager.h" |
| 20 #include "ui/aura/window_observer.h" | 20 #include "ui/aura/window_observer.h" |
| 21 #include "ui/keyboard/keyboard_controller.h" |
| 22 #include "ui/keyboard/keyboard_controller_observer.h" |
| 21 | 23 |
| 22 namespace aura { | 24 namespace aura { |
| 23 class Window; | 25 class Window; |
| 24 } | 26 } |
| 25 | 27 |
| 26 namespace gfx { | 28 namespace gfx { |
| 27 class Rect; | 29 class Rect; |
| 28 } | 30 } |
| 29 | 31 |
| 30 namespace views { | 32 namespace views { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 45 // The constructor takes a |panel_container| argument which is expected to set | 47 // The constructor takes a |panel_container| argument which is expected to set |
| 46 // its layout manager to this instance, e.g.: | 48 // its layout manager to this instance, e.g.: |
| 47 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); | 49 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); |
| 48 | 50 |
| 49 class ASH_EXPORT PanelLayoutManager | 51 class ASH_EXPORT PanelLayoutManager |
| 50 : public aura::LayoutManager, | 52 : public aura::LayoutManager, |
| 51 public ash::LauncherIconObserver, | 53 public ash::LauncherIconObserver, |
| 52 public ash::ShellObserver, | 54 public ash::ShellObserver, |
| 53 public aura::WindowObserver, | 55 public aura::WindowObserver, |
| 54 public aura::client::ActivationChangeObserver, | 56 public aura::client::ActivationChangeObserver, |
| 57 public keyboard::KeyboardControllerObserver, |
| 55 public ShelfLayoutManager::Observer { | 58 public ShelfLayoutManager::Observer { |
| 56 public: | 59 public: |
| 57 explicit PanelLayoutManager(aura::Window* panel_container); | 60 explicit PanelLayoutManager(aura::Window* panel_container); |
| 58 virtual ~PanelLayoutManager(); | 61 virtual ~PanelLayoutManager(); |
| 59 | 62 |
| 60 // Call Shutdown() before deleting children of panel_container. | 63 // Call Shutdown() before deleting children of panel_container. |
| 61 void Shutdown(); | 64 void Shutdown(); |
| 62 | 65 |
| 63 void StartDragging(aura::Window* panel); | 66 void StartDragging(aura::Window* panel); |
| 64 void FinishDragging(); | 67 void FinishDragging(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Called whenever the panel layout might change. | 136 // Called whenever the panel layout might change. |
| 134 void Relayout(); | 137 void Relayout(); |
| 135 | 138 |
| 136 // Called whenever the panel stacking order needs to be updated (e.g. focus | 139 // Called whenever the panel stacking order needs to be updated (e.g. focus |
| 137 // changes or a panel is moved). | 140 // changes or a panel is moved). |
| 138 void UpdateStacking(aura::Window* active_panel); | 141 void UpdateStacking(aura::Window* active_panel); |
| 139 | 142 |
| 140 // Update the callout arrows for all managed panels. | 143 // Update the callout arrows for all managed panels. |
| 141 void UpdateCallouts(); | 144 void UpdateCallouts(); |
| 142 | 145 |
| 146 // Overridden from keyboard::KeyboardControllerObserver: |
| 147 virtual void OnKeyboardBoundsChanging( |
| 148 const gfx::Rect& keyboard_bounds) OVERRIDE; |
| 149 |
| 143 // Parent window associated with this layout manager. | 150 // Parent window associated with this layout manager. |
| 144 aura::Window* panel_container_; | 151 aura::Window* panel_container_; |
| 145 // Protect against recursive calls to Relayout(). | 152 // Protect against recursive calls to Relayout(). |
| 146 bool in_layout_; | 153 bool in_layout_; |
| 147 // Ordered list of unowned pointers to panel windows. | 154 // Ordered list of unowned pointers to panel windows. |
| 148 PanelList panel_windows_; | 155 PanelList panel_windows_; |
| 149 // The panel being dragged. | 156 // The panel being dragged. |
| 150 aura::Window* dragged_panel_; | 157 aura::Window* dragged_panel_; |
| 151 // The launcher we are observing for launcher icon changes. | 158 // The launcher we are observing for launcher icon changes. |
| 152 Launcher* launcher_; | 159 Launcher* launcher_; |
| 153 // The shelf layout manager being observed for visibility changes. | 160 // The shelf layout manager being observed for visibility changes. |
| 154 ShelfLayoutManager* shelf_layout_manager_; | 161 ShelfLayoutManager* shelf_layout_manager_; |
| 155 // Tracks the visibility of the shelf. Defaults to false when there is no | 162 // Tracks the visibility of the shelf. Defaults to false when there is no |
| 156 // shelf. | 163 // shelf. |
| 157 bool shelf_hidden_; | 164 bool shelf_hidden_; |
| 158 // The last active panel. Used to maintain stacking even if no panels are | 165 // The last active panel. Used to maintain stacking even if no panels are |
| 159 // currently focused. | 166 // currently focused. |
| 160 aura::Window* last_active_panel_; | 167 aura::Window* last_active_panel_; |
| 161 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; | 168 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; |
| 162 | 169 |
| 163 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); | 170 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); |
| 164 }; | 171 }; |
| 165 | 172 |
| 166 } // namespace internal | 173 } // namespace internal |
| 167 } // namespace ash | 174 } // namespace ash |
| 168 | 175 |
| 169 #endif // ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ | 176 #endif // ASH_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| OLD | NEW |