Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: ash/common/wm/panels/panel_layout_manager.h

Issue 2746873003: Refactor PanelLayoutManager to use aura::LayoutManager (Closed)
Patch Set: minor Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/common/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_display_observer.h" 15 #include "ash/common/wm_display_observer.h"
16 #include "ash/common/wm_layout_manager.h"
17 #include "ash/root_window_controller.h" 16 #include "ash/root_window_controller.h"
18 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
19 #include "base/macros.h" 18 #include "base/macros.h"
20 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
21 #include "base/scoped_observer.h" 20 #include "base/scoped_observer.h"
21 #include "ui/aura/layout_manager.h"
22 #include "ui/aura/window_observer.h" 22 #include "ui/aura/window_observer.h"
23 #include "ui/aura/window_tracker.h" 23 #include "ui/aura/window_tracker.h"
24 #include "ui/keyboard/keyboard_controller.h" 24 #include "ui/keyboard/keyboard_controller.h"
25 #include "ui/keyboard/keyboard_controller_observer.h" 25 #include "ui/keyboard/keyboard_controller_observer.h"
26 #include "ui/wm/public/activation_change_observer.h" 26 #include "ui/wm/public/activation_change_observer.h"
27 27
28 namespace gfx { 28 namespace gfx {
29 class Rect; 29 class Rect;
30 } 30 }
31 31
(...skipping 12 matching lines...) Expand all
44 // PanelLayoutManager is responsible for organizing panels within the 44 // PanelLayoutManager is responsible for organizing panels within the
45 // workspace. It is associated with a specific container window (i.e. 45 // workspace. It is associated with a specific container window (i.e.
46 // kShellWindowId_PanelContainer) and controls the layout of any windows 46 // kShellWindowId_PanelContainer) and controls the layout of any windows
47 // added to that container. 47 // added to that container.
48 // 48 //
49 // The constructor takes a |panel_container| argument which is expected to set 49 // The constructor takes a |panel_container| argument which is expected to set
50 // its layout manager to this instance, e.g.: 50 // its layout manager to this instance, e.g.:
51 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); 51 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container));
52 52
53 class ASH_EXPORT PanelLayoutManager 53 class ASH_EXPORT PanelLayoutManager
54 : public WmLayoutManager, 54 : public aura::LayoutManager,
55 public wm::WindowStateObserver, 55 public wm::WindowStateObserver,
56 public aura::client::ActivationChangeObserver, 56 public aura::client::ActivationChangeObserver,
57 public WmDisplayObserver, 57 public WmDisplayObserver,
58 public ShellObserver, 58 public ShellObserver,
59 public aura::WindowObserver, 59 public aura::WindowObserver,
60 public keyboard::KeyboardControllerObserver, 60 public keyboard::KeyboardControllerObserver,
61 public WmShelfObserver { 61 public WmShelfObserver {
62 public: 62 public:
63 explicit PanelLayoutManager(WmWindow* panel_container); 63 explicit PanelLayoutManager(WmWindow* panel_container);
64 ~PanelLayoutManager() override; 64 ~PanelLayoutManager() override;
(...skipping 12 matching lines...) Expand all
77 77
78 // Hide / Show the panel callout widgets. 78 // Hide / Show the panel callout widgets.
79 void SetShowCalloutWidgets(bool show); 79 void SetShowCalloutWidgets(bool show);
80 80
81 // Returns the callout widget (arrow) for |panel|. 81 // Returns the callout widget (arrow) for |panel|.
82 views::Widget* GetCalloutWidgetForPanel(WmWindow* panel); 82 views::Widget* GetCalloutWidgetForPanel(WmWindow* panel);
83 83
84 WmShelf* shelf() { return shelf_; } 84 WmShelf* shelf() { return shelf_; }
85 void SetShelf(WmShelf* shelf); 85 void SetShelf(WmShelf* shelf);
86 86
87 // Overridden from WmLayoutManager 87 // WmLayoutManager:
88 void OnWindowResized() override; 88 void OnWindowResized() override;
89 void OnWindowAddedToLayout(WmWindow* child) override; 89 void OnWindowAddedToLayout(aura::Window* child) override;
90 void OnWillRemoveWindowFromLayout(WmWindow* child) override; 90 void OnWillRemoveWindowFromLayout(aura::Window* child) override;
91 void OnWindowRemovedFromLayout(WmWindow* child) override; 91 void OnWindowRemovedFromLayout(aura::Window* child) override;
92 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; 92 void OnChildWindowVisibilityChanged(aura::Window* child,
93 void SetChildBounds(WmWindow* child, 93 bool visibile) override;
94 void SetChildBounds(aura::Window* child,
94 const gfx::Rect& requested_bounds) override; 95 const gfx::Rect& requested_bounds) override;
95 96
96 // Overridden from ShellObserver: 97 // ShellObserver:
97 void OnOverviewModeEnded() override; 98 void OnOverviewModeEnded() override;
98 void OnShelfAlignmentChanged(WmWindow* root_window) override; 99 void OnShelfAlignmentChanged(WmWindow* root_window) override;
99 void OnVirtualKeyboardStateChanged(bool activated, 100 void OnVirtualKeyboardStateChanged(bool activated,
100 WmWindow* root_window) override; 101 WmWindow* root_window) override;
101 102
102 // Overridden from aura::WindowObserver 103 // aura::WindowObserver
103 void OnWindowPropertyChanged(aura::Window* window, 104 void OnWindowPropertyChanged(aura::Window* window,
104 const void* key, 105 const void* key,
105 intptr_t old) override; 106 intptr_t old) override;
106 107
107 // Overridden from wm::WindowStateObserver 108 // wm::WindowStateObserver:
108 void OnPostWindowStateTypeChange(wm::WindowState* window_state, 109 void OnPostWindowStateTypeChange(wm::WindowState* window_state,
109 wm::WindowStateType old_type) override; 110 wm::WindowStateType old_type) override;
110 111
111 // Overridden from aura::client::ActivationChangeObserver 112 // aura::client::ActivationChangeObserver:
112 void OnWindowActivated(ActivationReason reason, 113 void OnWindowActivated(ActivationReason reason,
113 aura::Window* gained_active, 114 aura::Window* gained_active,
114 aura::Window* lost_active) override; 115 aura::Window* lost_active) override;
115 116
116 // Overridden from WindowTreeHostManager::Observer 117 // WindowTreeHostManager::Observer:
117 void OnDisplayConfigurationChanged() override; 118 void OnDisplayConfigurationChanged() override;
118 119
119 // Overridden from WmShelfObserver 120 // WmShelfObserver:
120 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; 121 void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
121 void OnShelfIconPositionsChanged() override; 122 void OnShelfIconPositionsChanged() override;
122 123
123 private: 124 private:
124 friend class PanelLayoutManagerTest; 125 friend class PanelLayoutManagerTest;
125 friend class PanelWindowResizerTest; 126 friend class PanelWindowResizerTest;
126 friend class DockedWindowResizerTest; 127 friend class DockedWindowResizerTest;
127 friend class DockedWindowLayoutManagerTest; 128 friend class DockedWindowLayoutManagerTest;
128 friend class WorkspaceControllerTest; 129 friend class WorkspaceControllerTest;
129 friend class AcceleratorControllerTest; 130 friend class AcceleratorControllerTest;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 keyboard_observer_; 206 keyboard_observer_;
206 207
207 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; 208 base::WeakPtrFactory<PanelLayoutManager> weak_factory_;
208 209
209 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); 210 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager);
210 }; 211 };
211 212
212 } // namespace ash 213 } // namespace ash
213 214
214 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ 215 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/common/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698