| 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_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| 6 #define ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_COMMON_SHELF_SHELF_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 18 matching lines...) Expand all Loading... |
| 29 namespace ui { | 29 namespace ui { |
| 30 class ImplicitAnimationObserver; | 30 class ImplicitAnimationObserver; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace ash { | 33 namespace ash { |
| 34 | 34 |
| 35 class PanelLayoutManagerTest; | 35 class PanelLayoutManagerTest; |
| 36 class ShelfLayoutManagerObserver; | 36 class ShelfLayoutManagerObserver; |
| 37 class ShelfLayoutManagerTest; | 37 class ShelfLayoutManagerTest; |
| 38 class ShelfWidget; | 38 class ShelfWidget; |
| 39 class WmShelf; |
| 39 | 40 |
| 40 // ShelfLayoutManager is the layout manager responsible for the shelf and | 41 // ShelfLayoutManager is the layout manager responsible for the shelf and |
| 41 // status widgets. The shelf is given the total available width and told the | 42 // status widgets. The shelf is given the total available width and told the |
| 42 // width of the status area. This allows the shelf to draw the background and | 43 // width of the status area. This allows the shelf to draw the background and |
| 43 // layout to the status area. | 44 // layout to the status area. |
| 44 // To respond to bounds changes in the status area StatusAreaLayoutManager works | 45 // To respond to bounds changes in the status area StatusAreaLayoutManager works |
| 45 // closely with ShelfLayoutManager. | 46 // closely with ShelfLayoutManager. |
| 46 // On mus, widget bounds management is handled by the window manager. | 47 // On mus, widget bounds management is handled by the window manager. |
| 47 class ASH_EXPORT ShelfLayoutManager | 48 class ASH_EXPORT ShelfLayoutManager |
| 48 : public ShellObserver, | 49 : public ShellObserver, |
| 49 public WmActivationObserver, | 50 public WmActivationObserver, |
| 50 public DockedWindowLayoutManagerObserver, | 51 public DockedWindowLayoutManagerObserver, |
| 51 public keyboard::KeyboardControllerObserver, | 52 public keyboard::KeyboardControllerObserver, |
| 52 public LockStateObserver, | 53 public LockStateObserver, |
| 53 public wm::WmSnapToPixelLayoutManager, | 54 public wm::WmSnapToPixelLayoutManager, |
| 54 public SessionStateObserver { | 55 public SessionStateObserver { |
| 55 public: | 56 public: |
| 56 explicit ShelfLayoutManager(ShelfWidget* shelf_widget); | 57 ShelfLayoutManager(ShelfWidget* shelf_widget, WmShelf* wm_shelf); |
| 57 ~ShelfLayoutManager() override; | 58 ~ShelfLayoutManager() override; |
| 58 | 59 |
| 59 bool updating_bounds() const { return updating_bounds_; } | 60 bool updating_bounds() const { return updating_bounds_; } |
| 60 | 61 |
| 61 // Clears internal data for shutdown process. | 62 // Clears internal data for shutdown process. |
| 62 void PrepareForShutdown(); | 63 void PrepareForShutdown(); |
| 63 | 64 |
| 64 // Returns whether the shelf and its contents (shelf, status) are visible | 65 // Returns whether the shelf and its contents (shelf, status) are visible |
| 65 // on the screen. | 66 // on the screen. |
| 66 bool IsVisible() const; | 67 bool IsVisible() const; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 309 |
| 309 bool in_shutdown_ = false; | 310 bool in_shutdown_ = false; |
| 310 | 311 |
| 311 // True if the last mouse event was a mouse drag. | 312 // True if the last mouse event was a mouse drag. |
| 312 bool in_mouse_drag_ = false; | 313 bool in_mouse_drag_ = false; |
| 313 | 314 |
| 314 // Current state. | 315 // Current state. |
| 315 State state_; | 316 State state_; |
| 316 | 317 |
| 317 ShelfWidget* shelf_widget_; | 318 ShelfWidget* shelf_widget_; |
| 319 WmShelf* wm_shelf_; |
| 318 | 320 |
| 319 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. | 321 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. |
| 320 bool window_overlaps_shelf_; | 322 bool window_overlaps_shelf_; |
| 321 | 323 |
| 322 base::OneShotTimer auto_hide_timer_; | 324 base::OneShotTimer auto_hide_timer_; |
| 323 | 325 |
| 324 // Whether the mouse was over the shelf when the auto hide timer started. | 326 // Whether the mouse was over the shelf when the auto hide timer started. |
| 325 // False when neither the auto hide timer nor the timer task are running. | 327 // False when neither the auto hide timer nor the timer task are running. |
| 326 bool mouse_over_shelf_when_auto_hide_timer_started_; | 328 bool mouse_over_shelf_when_auto_hide_timer_started_; |
| 327 | 329 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 374 |
| 373 std::unique_ptr<RootWindowControllerObserverImpl> | 375 std::unique_ptr<RootWindowControllerObserverImpl> |
| 374 root_window_controller_observer_; | 376 root_window_controller_observer_; |
| 375 | 377 |
| 376 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 378 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
| 377 }; | 379 }; |
| 378 | 380 |
| 379 } // namespace ash | 381 } // namespace ash |
| 380 | 382 |
| 381 #endif // ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ | 383 #endif // ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| OLD | NEW |