Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_SHELF_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| 6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 // closely with ShelfLayoutManager. | 60 // closely with ShelfLayoutManager. |
| 61 class ASH_EXPORT ShelfLayoutManager | 61 class ASH_EXPORT ShelfLayoutManager |
| 62 : public ash::ShellObserver, | 62 : public ash::ShellObserver, |
| 63 public aura::client::ActivationChangeObserver, | 63 public aura::client::ActivationChangeObserver, |
| 64 public DockedWindowLayoutManagerObserver, | 64 public DockedWindowLayoutManagerObserver, |
| 65 public keyboard::KeyboardControllerObserver, | 65 public keyboard::KeyboardControllerObserver, |
| 66 public LockStateObserver, | 66 public LockStateObserver, |
| 67 public SnapToPixelLayoutManager, | 67 public SnapToPixelLayoutManager, |
| 68 public SessionStateObserver { | 68 public SessionStateObserver { |
| 69 public: | 69 public: |
| 70 // We reserve a small area on the edge of the workspace area to ensure that | 70 enum ShelfItemInset { |
| 71 // the resize handle at the edge of the window can be hit. | 71 // Inset between the inner edge of the shelf (towards centre of screen), and |
| 72 static const int kWorkspaceAreaVisibleInset; | 72 // the shelf items, notifications, status area etc. |
| 73 | 73 SHELF_ITEM_INSET, |
|
bruthig
2016/05/25 20:24:52
Can this be moved to the ShelfLayoutConstants enum
| |
| 74 // When autohidden we extend the touch hit target onto the screen so that the | 74 }; |
| 75 // user can drag the shelf out. | |
| 76 static const int kWorkspaceAreaAutoHideInset; | |
| 77 | |
| 78 // Size of the shelf when auto-hidden. | |
| 79 static const int kAutoHideSize; | |
| 80 | |
| 81 // Inset between the inner edge of the shelf (towards centre of screen), and | |
| 82 // the shelf items, notifications, status area etc. | |
| 83 static const int kShelfItemInset; | |
| 84 | 75 |
| 85 explicit ShelfLayoutManager(ShelfWidget* shelf); | 76 explicit ShelfLayoutManager(ShelfWidget* shelf); |
| 86 ~ShelfLayoutManager() override; | 77 ~ShelfLayoutManager() override; |
| 87 | 78 |
| 88 void set_workspace_controller(WorkspaceController* controller) { | 79 void set_workspace_controller(WorkspaceController* controller) { |
| 89 workspace_controller_ = controller; | 80 workspace_controller_ = controller; |
| 90 } | 81 } |
| 91 | 82 |
| 92 bool updating_bounds() const { return updating_bounds_; } | 83 bool updating_bounds() const { return updating_bounds_; } |
| 93 | 84 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 return IsHorizontalAlignment() ? horizontal : vertical; | 198 return IsHorizontalAlignment() ? horizontal : vertical; |
| 208 } | 199 } |
| 209 | 200 |
| 210 // Is the shelf's alignment horizontal? | 201 // Is the shelf's alignment horizontal? |
| 211 bool IsHorizontalAlignment() const; | 202 bool IsHorizontalAlignment() const; |
| 212 | 203 |
| 213 // Set the height of the ChromeVox panel, which takes away space from the | 204 // Set the height of the ChromeVox panel, which takes away space from the |
| 214 // available work area from the top of the screen. | 205 // available work area from the top of the screen. |
| 215 void SetChromeVoxPanelHeight(int height); | 206 void SetChromeVoxPanelHeight(int height); |
| 216 | 207 |
| 208 static int GetShelfItemInset(ShelfLayoutManager::ShelfItemInset constant); | |
| 209 | |
| 217 private: | 210 private: |
| 218 class AutoHideEventFilter; | 211 class AutoHideEventFilter; |
| 219 class RootWindowControllerObserverImpl; | 212 class RootWindowControllerObserverImpl; |
| 220 class UpdateShelfObserver; | 213 class UpdateShelfObserver; |
| 221 friend class AshPopupAlignmentDelegateTest; | 214 friend class AshPopupAlignmentDelegateTest; |
| 222 friend class ash::ScreenAsh; | 215 friend class ash::ScreenAsh; |
| 223 friend class PanelLayoutManagerTest; | 216 friend class PanelLayoutManagerTest; |
| 224 friend class ShelfLayoutManagerTest; | 217 friend class ShelfLayoutManagerTest; |
| 225 friend class ToastManagerTest; | 218 friend class ToastManagerTest; |
| 226 FRIEND_TEST_ALL_PREFIXES(ash::AshPopupAlignmentDelegateTest, AutoHide); | 219 FRIEND_TEST_ALL_PREFIXES(ash::AshPopupAlignmentDelegateTest, AutoHide); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 | 394 |
| 402 std::unique_ptr<RootWindowControllerObserverImpl> | 395 std::unique_ptr<RootWindowControllerObserverImpl> |
| 403 root_window_controller_observer_; | 396 root_window_controller_observer_; |
| 404 | 397 |
| 405 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 398 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
| 406 }; | 399 }; |
| 407 | 400 |
| 408 } // namespace ash | 401 } // namespace ash |
| 409 | 402 |
| 410 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 403 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| OLD | NEW |