OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shelf/shelf_layout_manager_observer.h" | 9 #include "ash/shelf/shelf_layout_manager_observer.h" |
10 #include "ash/shell_observer.h" | 10 #include "ash/shell_observer.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 | 35 |
36 namespace views { | 36 namespace views { |
37 class Widget; | 37 class Widget; |
38 } | 38 } |
39 | 39 |
40 namespace ash { | 40 namespace ash { |
41 class Launcher; | 41 class Launcher; |
42 | 42 |
43 namespace internal { | 43 namespace internal { |
| 44 class DockedBackgroundWidget; |
44 class DockedWindowLayoutManagerObserver; | 45 class DockedWindowLayoutManagerObserver; |
45 class DockedWindowResizerTest; | 46 class DockedWindowResizerTest; |
46 class ShelfLayoutManager; | 47 class ShelfLayoutManager; |
47 class WorkspaceController; | 48 class WorkspaceController; |
48 | 49 |
49 struct WindowWithHeight { | 50 struct WindowWithHeight { |
50 explicit WindowWithHeight(aura::Window* window) : | 51 explicit WindowWithHeight(aura::Window* window) : |
51 window_(window), | 52 window_(window), |
52 height_(window->bounds().height()) { } | 53 height_(window->bounds().height()) { } |
53 aura::Window* window() { return window_; } | 54 aura::Window* window() { return window_; } |
(...skipping 13 matching lines...) Expand all Loading... |
67 // new DockedWindowLayoutManager(dock_container)); | 68 // new DockedWindowLayoutManager(dock_container)); |
68 // | 69 // |
69 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit | 70 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit |
70 // common functionality. | 71 // common functionality. |
71 class ASH_EXPORT DockedWindowLayoutManager | 72 class ASH_EXPORT DockedWindowLayoutManager |
72 : public aura::LayoutManager, | 73 : public aura::LayoutManager, |
73 public ash::ShellObserver, | 74 public ash::ShellObserver, |
74 public aura::WindowObserver, | 75 public aura::WindowObserver, |
75 public aura::client::ActivationChangeObserver, | 76 public aura::client::ActivationChangeObserver, |
76 public keyboard::KeyboardControllerObserver, | 77 public keyboard::KeyboardControllerObserver, |
| 78 public ShelfLayoutManagerObserver, |
77 public wm::WindowStateObserver { | 79 public wm::WindowStateObserver { |
78 public: | 80 public: |
79 // Maximum width of the docked windows area. | 81 // Maximum width of the docked windows area. |
80 static const int kMaxDockWidth; | 82 static const int kMaxDockWidth; |
81 | 83 |
82 // Minimum width of the docked windows area. | 84 // Minimum width of the docked windows area. |
83 static const int kMinDockWidth; | 85 static const int kMinDockWidth; |
84 | 86 |
85 DockedWindowLayoutManager(aura::Window* dock_container, | 87 DockedWindowLayoutManager(aura::Window* dock_container, |
86 WorkspaceController* workspace_controller); | 88 WorkspaceController* workspace_controller); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 bool visibile) OVERRIDE; | 143 bool visibile) OVERRIDE; |
142 virtual void SetChildBounds(aura::Window* child, | 144 virtual void SetChildBounds(aura::Window* child, |
143 const gfx::Rect& requested_bounds) OVERRIDE; | 145 const gfx::Rect& requested_bounds) OVERRIDE; |
144 | 146 |
145 // ash::ShellObserver: | 147 // ash::ShellObserver: |
146 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; | 148 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; |
147 virtual void OnFullscreenStateChanged(bool is_fullscreen, | 149 virtual void OnFullscreenStateChanged(bool is_fullscreen, |
148 aura::Window* root_window) OVERRIDE; | 150 aura::Window* root_window) OVERRIDE; |
149 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; | 151 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; |
150 | 152 |
| 153 // ShelfLayoutManagerObserver: |
| 154 virtual void OnBackgroundUpdated( |
| 155 ShelfBackgroundType background_type, |
| 156 BackgroundAnimatorChangeType change_type) OVERRIDE; |
| 157 |
151 // wm::WindowStateObserver: | 158 // wm::WindowStateObserver: |
152 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, | 159 virtual void OnWindowShowTypeChanged(wm::WindowState* window_state, |
153 wm::WindowShowType old_type) OVERRIDE; | 160 wm::WindowShowType old_type) OVERRIDE; |
154 | 161 |
155 // aura::WindowObserver: | 162 // aura::WindowObserver: |
156 virtual void OnWindowBoundsChanged(aura::Window* window, | 163 virtual void OnWindowBoundsChanged(aura::Window* window, |
157 const gfx::Rect& old_bounds, | 164 const gfx::Rect& old_bounds, |
158 const gfx::Rect& new_bounds) OVERRIDE; | 165 const gfx::Rect& new_bounds) OVERRIDE; |
159 virtual void OnWindowVisibilityChanging(aura::Window* window, | 166 virtual void OnWindowVisibilityChanging(aura::Window* window, |
160 bool visible) OVERRIDE; | 167 bool visible) OVERRIDE; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // True if the window being dragged is currently docked. | 255 // True if the window being dragged is currently docked. |
249 bool is_dragged_window_docked_; | 256 bool is_dragged_window_docked_; |
250 | 257 |
251 // Previously docked windows use a more relaxed dragging sorting algorithm | 258 // Previously docked windows use a more relaxed dragging sorting algorithm |
252 // that uses assumption that a window starts being dragged out of position | 259 // that uses assumption that a window starts being dragged out of position |
253 // that was previously established in Relayout. This allows easier reordering. | 260 // that was previously established in Relayout. This allows easier reordering. |
254 bool is_dragged_from_dock_; | 261 bool is_dragged_from_dock_; |
255 | 262 |
256 // The launcher to respond to launcher alignment changes. | 263 // The launcher to respond to launcher alignment changes. |
257 Launcher* launcher_; | 264 Launcher* launcher_; |
| 265 |
258 // Workspace controller that can be checked for fullscreen mode. | 266 // Workspace controller that can be checked for fullscreen mode. |
259 WorkspaceController* workspace_controller_; | 267 WorkspaceController* workspace_controller_; |
260 // Tracks if any window in the same root window is in fullscreen mode. | 268 // Tracks if any window in the same root window is in fullscreen mode. |
261 bool in_fullscreen_; | 269 bool in_fullscreen_; |
262 // Current width of the dock. | 270 // Current width of the dock. |
263 int docked_width_; | 271 int docked_width_; |
264 | 272 |
265 // Last bounds that were sent to observers. | 273 // Last bounds that were sent to observers. |
266 gfx::Rect docked_bounds_; | 274 gfx::Rect docked_bounds_; |
267 | 275 |
268 // Target bounds of a docked window being dragged. | 276 // Target bounds of a docked window being dragged. |
269 gfx::Rect dragged_bounds_; | 277 gfx::Rect dragged_bounds_; |
270 | 278 |
271 // Side of the screen that the dock is positioned at. | 279 // Side of the screen that the dock is positioned at. |
272 DockedAlignment alignment_; | 280 DockedAlignment alignment_; |
273 | 281 |
274 // The last active window. Used to maintain stacking order even if no windows | 282 // The last active window. Used to maintain stacking order even if no windows |
275 // are currently focused. | 283 // are currently focused. |
276 aura::Window* last_active_window_; | 284 aura::Window* last_active_window_; |
277 | 285 |
278 // Timestamp of the last user-initiated action that changed docked state. | 286 // Timestamp of the last user-initiated action that changed docked state. |
279 // Used in UMA metrics. | 287 // Used in UMA metrics. |
280 base::Time last_action_time_; | 288 base::Time last_action_time_; |
281 | 289 |
282 // Widget used to paint a background for the docked area. | 290 // Widget used to paint a background for the docked area. |
283 scoped_ptr<views::Widget> background_widget_; | 291 scoped_ptr<DockedBackgroundWidget> background_widget_; |
284 | 292 |
285 // Observers of dock bounds changes. | 293 // Observers of dock bounds changes. |
286 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 294 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
287 | 295 |
288 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 296 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
289 }; | 297 }; |
290 | 298 |
291 } // namespace internal | 299 } // namespace internal |
292 } // namespace ash | 300 } // namespace ash |
293 | 301 |
294 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 302 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
OLD | NEW |