| 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_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| 6 #define ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ | 6 #define ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/common/shelf/wm_shelf_observer.h" | 12 #include "ash/common/shelf/wm_shelf_observer.h" |
| 13 #include "ash/common/shell_observer.h" | 13 #include "ash/common/shell_observer.h" |
| 14 #include "ash/common/wm/window_state_observer.h" | 14 #include "ash/common/wm/window_state_observer.h" |
| 15 #include "ash/common/wm_activation_observer.h" | |
| 16 #include "ash/common/wm_display_observer.h" | 15 #include "ash/common/wm_display_observer.h" |
| 17 #include "ash/common/wm_layout_manager.h" | 16 #include "ash/common/wm_layout_manager.h" |
| 18 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 19 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 20 #include "base/macros.h" | 19 #include "base/macros.h" |
| 21 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 22 #include "ui/aura/window_observer.h" | 21 #include "ui/aura/window_observer.h" |
| 23 #include "ui/aura/window_tracker.h" | 22 #include "ui/aura/window_tracker.h" |
| 24 #include "ui/keyboard/keyboard_controller.h" | 23 #include "ui/keyboard/keyboard_controller.h" |
| 25 #include "ui/keyboard/keyboard_controller_observer.h" | 24 #include "ui/keyboard/keyboard_controller_observer.h" |
| 25 #include "ui/wm/public/activation_change_observer.h" |
| 26 | 26 |
| 27 namespace gfx { | 27 namespace gfx { |
| 28 class Rect; | 28 class Rect; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace views { | 31 namespace views { |
| 32 class Widget; | 32 class Widget; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace ash { | 35 namespace ash { |
| 36 class PanelCalloutWidget; | 36 class PanelCalloutWidget; |
| 37 class WmShelf; | 37 class WmShelf; |
| 38 | 38 |
| 39 namespace wm { | 39 namespace wm { |
| 40 class RootWindowController; | 40 class RootWindowController; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // PanelLayoutManager is responsible for organizing panels within the | 43 // PanelLayoutManager is responsible for organizing panels within the |
| 44 // workspace. It is associated with a specific container window (i.e. | 44 // workspace. It is associated with a specific container window (i.e. |
| 45 // kShellWindowId_PanelContainer) and controls the layout of any windows | 45 // kShellWindowId_PanelContainer) and controls the layout of any windows |
| 46 // added to that container. | 46 // added to that container. |
| 47 // | 47 // |
| 48 // The constructor takes a |panel_container| argument which is expected to set | 48 // The constructor takes a |panel_container| argument which is expected to set |
| 49 // its layout manager to this instance, e.g.: | 49 // its layout manager to this instance, e.g.: |
| 50 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); | 50 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); |
| 51 | 51 |
| 52 class ASH_EXPORT PanelLayoutManager | 52 class ASH_EXPORT PanelLayoutManager |
| 53 : public WmLayoutManager, | 53 : public WmLayoutManager, |
| 54 public wm::WindowStateObserver, | 54 public wm::WindowStateObserver, |
| 55 public WmActivationObserver, | 55 public aura::client::ActivationChangeObserver, |
| 56 public WmDisplayObserver, | 56 public WmDisplayObserver, |
| 57 public ShellObserver, | 57 public ShellObserver, |
| 58 public aura::WindowObserver, | 58 public aura::WindowObserver, |
| 59 public keyboard::KeyboardControllerObserver, | 59 public keyboard::KeyboardControllerObserver, |
| 60 public WmShelfObserver { | 60 public WmShelfObserver { |
| 61 public: | 61 public: |
| 62 explicit PanelLayoutManager(WmWindow* panel_container); | 62 explicit PanelLayoutManager(WmWindow* panel_container); |
| 63 ~PanelLayoutManager() override; | 63 ~PanelLayoutManager() override; |
| 64 | 64 |
| 65 // Returns the PanelLayoutManager in the specified hierarchy. This searches | 65 // Returns the PanelLayoutManager in the specified hierarchy. This searches |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // Overridden from aura::WindowObserver | 99 // Overridden from aura::WindowObserver |
| 100 void OnWindowPropertyChanged(aura::Window* window, | 100 void OnWindowPropertyChanged(aura::Window* window, |
| 101 const void* key, | 101 const void* key, |
| 102 intptr_t old) override; | 102 intptr_t old) override; |
| 103 | 103 |
| 104 // Overridden from wm::WindowStateObserver | 104 // Overridden from wm::WindowStateObserver |
| 105 void OnPostWindowStateTypeChange(wm::WindowState* window_state, | 105 void OnPostWindowStateTypeChange(wm::WindowState* window_state, |
| 106 wm::WindowStateType old_type) override; | 106 wm::WindowStateType old_type) override; |
| 107 | 107 |
| 108 // Overridden from WmActivationObserver | 108 // Overridden from aura::client::ActivationChangeObserver |
| 109 void OnWindowActivated(WmWindow* gained_active, | 109 void OnWindowActivated(ActivationReason reason, |
| 110 WmWindow* lost_active) override; | 110 aura::Window* gained_active, |
| 111 aura::Window* lost_active) override; |
| 111 | 112 |
| 112 // Overridden from WindowTreeHostManager::Observer | 113 // Overridden from WindowTreeHostManager::Observer |
| 113 void OnDisplayConfigurationChanged() override; | 114 void OnDisplayConfigurationChanged() override; |
| 114 | 115 |
| 115 // Overridden from WmShelfObserver | 116 // Overridden from WmShelfObserver |
| 116 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; | 117 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
| 117 void OnShelfIconPositionsChanged() override; | 118 void OnShelfIconPositionsChanged() override; |
| 118 | 119 |
| 119 private: | 120 private: |
| 120 friend class PanelLayoutManagerTest; | 121 friend class PanelLayoutManagerTest; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // are currently focused. | 197 // are currently focused. |
| 197 WmWindow* last_active_panel_; | 198 WmWindow* last_active_panel_; |
| 198 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; | 199 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; |
| 199 | 200 |
| 200 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); | 201 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); |
| 201 }; | 202 }; |
| 202 | 203 |
| 203 } // namespace ash | 204 } // namespace ash |
| 204 | 205 |
| 205 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ | 206 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ |
| OLD | NEW |