| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 class Widget; | 35 class Widget; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace ash { | 38 namespace ash { |
| 39 class DockedBackgroundWidget; | 39 class DockedBackgroundWidget; |
| 40 class DockedWindowLayoutManagerObserver; | 40 class DockedWindowLayoutManagerObserver; |
| 41 class DockedWindowResizerTest; | 41 class DockedWindowResizerTest; |
| 42 class Shelf; | 42 class Shelf; |
| 43 class WorkspaceController; | 43 class WorkspaceController; |
| 44 | 44 |
| 45 struct WindowWithHeight { | |
| 46 explicit WindowWithHeight(aura::Window* window) : | |
| 47 window_(window), | |
| 48 height_(window->bounds().height()) { } | |
| 49 aura::Window* window() { return window_; } | |
| 50 const aura::Window* window() const { return window_; } | |
| 51 aura::Window* window_; | |
| 52 int height_; | |
| 53 }; | |
| 54 | |
| 55 // DockedWindowLayoutManager is responsible for organizing windows when they are | 45 // DockedWindowLayoutManager is responsible for organizing windows when they are |
| 56 // docked to the side of a screen. It is associated with a specific container | 46 // docked to the side of a screen. It is associated with a specific container |
| 57 // window (i.e. kShellWindowId_DockContainer) and controls the layout of any | 47 // window (i.e. kShellWindowId_DockContainer) and controls the layout of any |
| 58 // windows added to that container. | 48 // windows added to that container. |
| 59 // | 49 // |
| 60 // The constructor takes a |dock_container| argument which is expected to set | 50 // The constructor takes a |dock_container| argument which is expected to set |
| 61 // its layout manager to this instance, e.g.: | 51 // its layout manager to this instance, e.g.: |
| 62 // dock_container->SetLayoutManager( | 52 // dock_container->SetLayoutManager( |
| 63 // new DockedWindowLayoutManager(dock_container)); | 53 // new DockedWindowLayoutManager(dock_container)); |
| 64 // | 54 // |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; | 161 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; |
| 172 void OnWindowDestroying(aura::Window* window) override; | 162 void OnWindowDestroying(aura::Window* window) override; |
| 173 | 163 |
| 174 // aura::client::ActivationChangeObserver: | 164 // aura::client::ActivationChangeObserver: |
| 175 void OnWindowActivated( | 165 void OnWindowActivated( |
| 176 aura::client::ActivationChangeObserver::ActivationReason reason, | 166 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 177 aura::Window* gained_active, | 167 aura::Window* gained_active, |
| 178 aura::Window* lost_active) override; | 168 aura::Window* lost_active) override; |
| 179 | 169 |
| 180 private: | 170 private: |
| 171 struct CompareMinimumHeight; |
| 172 struct CompareWindowPos; |
| 181 class ShelfWindowObserver; | 173 class ShelfWindowObserver; |
| 174 struct WindowWithHeight; |
| 175 |
| 182 friend class DockedWindowLayoutManagerTest; | 176 friend class DockedWindowLayoutManagerTest; |
| 183 friend class DockedWindowResizerTest; | 177 friend class DockedWindowResizerTest; |
| 184 | 178 |
| 185 // Width of the gap between the docked windows and a workspace. | 179 // Width of the gap between the docked windows and a workspace. |
| 186 static const int kMinDockGap; | 180 static const int kMinDockGap; |
| 187 | 181 |
| 188 // Ideal (starting) width of the dock. | 182 // Ideal (starting) width of the dock. |
| 189 static const int kIdealWidth; | 183 static const int kIdealWidth; |
| 190 | 184 |
| 191 // Returns the alignment of the docked windows other than the |child|. | 185 // Returns the alignment of the docked windows other than the |child|. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 314 |
| 321 // Observers of dock bounds changes. | 315 // Observers of dock bounds changes. |
| 322 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 316 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 323 | 317 |
| 324 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 318 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 325 }; | 319 }; |
| 326 | 320 |
| 327 } // namespace ash | 321 } // namespace ash |
| 328 | 322 |
| 329 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 323 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |