| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Returns last known coordinates of |dragged_window_| after Relayout. | 128 // Returns last known coordinates of |dragged_window_| after Relayout. |
| 129 const gfx::Rect dragged_bounds() const { return dragged_bounds_;} | 129 const gfx::Rect dragged_bounds() const { return dragged_bounds_;} |
| 130 | 130 |
| 131 // Returns true if currently dragged window is docked at the screen edge. | 131 // Returns true if currently dragged window is docked at the screen edge. |
| 132 bool is_dragged_window_docked() const { return is_dragged_window_docked_; } | 132 bool is_dragged_window_docked() const { return is_dragged_window_docked_; } |
| 133 | 133 |
| 134 // Updates docked layout when shelf bounds change. | 134 // Updates docked layout when shelf bounds change. |
| 135 void OnShelfBoundsChanged(); | 135 void OnShelfBoundsChanged(); |
| 136 | 136 |
| 137 // SnapLayoutManager: | 137 // SnapLayoutManager: |
| 138 virtual void OnWindowResized() OVERRIDE; | 138 virtual void OnWindowResized() override; |
| 139 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 139 virtual void OnWindowAddedToLayout(aura::Window* child) override; |
| 140 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE {} | 140 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override {} |
| 141 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | 141 virtual void OnWindowRemovedFromLayout(aura::Window* child) override; |
| 142 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 142 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
| 143 bool visibile) OVERRIDE; | 143 bool visibile) override; |
| 144 virtual void SetChildBounds(aura::Window* child, | 144 virtual void SetChildBounds(aura::Window* child, |
| 145 const gfx::Rect& requested_bounds) OVERRIDE; | 145 const gfx::Rect& requested_bounds) override; |
| 146 | 146 |
| 147 // ash::ShellObserver: | 147 // ash::ShellObserver: |
| 148 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; | 148 virtual void OnDisplayWorkAreaInsetsChanged() override; |
| 149 virtual void OnFullscreenStateChanged(bool is_fullscreen, | 149 virtual void OnFullscreenStateChanged(bool is_fullscreen, |
| 150 aura::Window* root_window) OVERRIDE; | 150 aura::Window* root_window) override; |
| 151 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; | 151 virtual void OnShelfAlignmentChanged(aura::Window* root_window) override; |
| 152 | 152 |
| 153 // ShelfLayoutManagerObserver: | 153 // ShelfLayoutManagerObserver: |
| 154 virtual void OnBackgroundUpdated( | 154 virtual void OnBackgroundUpdated( |
| 155 ShelfBackgroundType background_type, | 155 ShelfBackgroundType background_type, |
| 156 BackgroundAnimatorChangeType change_type) OVERRIDE; | 156 BackgroundAnimatorChangeType change_type) override; |
| 157 | 157 |
| 158 // wm::WindowStateObserver: | 158 // wm::WindowStateObserver: |
| 159 virtual void OnPreWindowStateTypeChange( | 159 virtual void OnPreWindowStateTypeChange( |
| 160 wm::WindowState* window_state, | 160 wm::WindowState* window_state, |
| 161 wm::WindowStateType old_type) OVERRIDE; | 161 wm::WindowStateType old_type) override; |
| 162 | 162 |
| 163 // aura::WindowObserver: | 163 // aura::WindowObserver: |
| 164 virtual void OnWindowBoundsChanged(aura::Window* window, | 164 virtual void OnWindowBoundsChanged(aura::Window* window, |
| 165 const gfx::Rect& old_bounds, | 165 const gfx::Rect& old_bounds, |
| 166 const gfx::Rect& new_bounds) OVERRIDE; | 166 const gfx::Rect& new_bounds) override; |
| 167 virtual void OnWindowVisibilityChanging(aura::Window* window, | 167 virtual void OnWindowVisibilityChanging(aura::Window* window, |
| 168 bool visible) OVERRIDE; | 168 bool visible) override; |
| 169 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 169 virtual void OnWindowDestroying(aura::Window* window) override; |
| 170 | 170 |
| 171 // aura::client::ActivationChangeObserver: | 171 // aura::client::ActivationChangeObserver: |
| 172 virtual void OnWindowActivated(aura::Window* gained_active, | 172 virtual void OnWindowActivated(aura::Window* gained_active, |
| 173 aura::Window* lost_active) OVERRIDE; | 173 aura::Window* lost_active) override; |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 class ShelfWindowObserver; | 176 class ShelfWindowObserver; |
| 177 friend class DockedWindowLayoutManagerTest; | 177 friend class DockedWindowLayoutManagerTest; |
| 178 friend class DockedWindowResizerTest; | 178 friend class DockedWindowResizerTest; |
| 179 | 179 |
| 180 // Width of the gap between the docked windows and a workspace. | 180 // Width of the gap between the docked windows and a workspace. |
| 181 static const int kMinDockGap; | 181 static const int kMinDockGap; |
| 182 | 182 |
| 183 // Ideal (starting) width of the dock. | 183 // Ideal (starting) width of the dock. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // area change. Passing |reason| to observers allows selectively skipping | 240 // area change. Passing |reason| to observers allows selectively skipping |
| 241 // notifications. | 241 // notifications. |
| 242 void UpdateDockBounds(DockedWindowLayoutManagerObserver::Reason reason); | 242 void UpdateDockBounds(DockedWindowLayoutManagerObserver::Reason reason); |
| 243 | 243 |
| 244 // Called whenever the window stacking order needs to be updated (e.g. focus | 244 // Called whenever the window stacking order needs to be updated (e.g. focus |
| 245 // changes or a window is moved). | 245 // changes or a window is moved). |
| 246 void UpdateStacking(aura::Window* active_window); | 246 void UpdateStacking(aura::Window* active_window); |
| 247 | 247 |
| 248 // keyboard::KeyboardControllerObserver: | 248 // keyboard::KeyboardControllerObserver: |
| 249 virtual void OnKeyboardBoundsChanging( | 249 virtual void OnKeyboardBoundsChanging( |
| 250 const gfx::Rect& keyboard_bounds) OVERRIDE; | 250 const gfx::Rect& keyboard_bounds) override; |
| 251 | 251 |
| 252 // Parent window associated with this layout manager. | 252 // Parent window associated with this layout manager. |
| 253 aura::Window* dock_container_; | 253 aura::Window* dock_container_; |
| 254 // Protect against recursive calls to Relayout(). | 254 // Protect against recursive calls to Relayout(). |
| 255 bool in_layout_; | 255 bool in_layout_; |
| 256 | 256 |
| 257 // A window that is being dragged (whether docked or not). | 257 // A window that is being dragged (whether docked or not). |
| 258 // Windows are tracked by docked layout manager only if they are docked; | 258 // Windows are tracked by docked layout manager only if they are docked; |
| 259 // however we need to know if a window is being dragged in order to avoid | 259 // however we need to know if a window is being dragged in order to avoid |
| 260 // positioning it or even considering it for layout. | 260 // positioning it or even considering it for layout. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 // Observers of dock bounds changes. | 304 // Observers of dock bounds changes. |
| 305 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 305 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 306 | 306 |
| 307 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 307 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 } // namespace ash | 310 } // namespace ash |
| 311 | 311 |
| 312 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 312 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |