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 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 : public ShellObserver, | 53 : public ShellObserver, |
| 54 public ::wm::ActivationChangeObserver, | 54 public ::wm::ActivationChangeObserver, |
| 55 public keyboard::KeyboardControllerObserver, | 55 public keyboard::KeyboardControllerObserver, |
| 56 public LockStateObserver, | 56 public LockStateObserver, |
| 57 public wm::WmSnapToPixelLayoutManager, | 57 public wm::WmSnapToPixelLayoutManager, |
| 58 public SessionObserver { | 58 public SessionObserver { |
| 59 public: | 59 public: |
| 60 ShelfLayoutManager(ShelfWidget* shelf_widget, Shelf* shelf); | 60 ShelfLayoutManager(ShelfWidget* shelf_widget, Shelf* shelf); |
| 61 ~ShelfLayoutManager() override; | 61 ~ShelfLayoutManager() override; |
| 62 | 62 |
| 63 // Called when the AppList status changes. | |
| 64 void OnAppListIsActive(); | |
|
xiyuan
2017/06/06 16:50:18
Can this be removed since we have OnAppListVisibil
newcomer
2017/06/06 17:12:56
Done.
| |
| 65 | |
| 63 bool updating_bounds() const { return updating_bounds_; } | 66 bool updating_bounds() const { return updating_bounds_; } |
| 64 | 67 |
| 65 // Clears internal data for shutdown process. | 68 // Clears internal data for shutdown process. |
| 66 void PrepareForShutdown(); | 69 void PrepareForShutdown(); |
| 67 | |
| 68 // Returns whether the shelf and its contents (shelf, status) are visible | 70 // Returns whether the shelf and its contents (shelf, status) are visible |
| 69 // on the screen. | 71 // on the screen. |
| 70 bool IsVisible() const; | 72 bool IsVisible() const; |
| 71 | 73 |
| 72 // Returns the ideal bounds of the shelf assuming it is visible. | 74 // Returns the ideal bounds of the shelf assuming it is visible. |
| 73 gfx::Rect GetIdealBounds(); | 75 gfx::Rect GetIdealBounds(); |
| 74 | 76 |
| 75 // Returns the preferred size of the shelf for the target visibility state. | 77 // Returns the preferred size of the shelf for the target visibility state. |
| 76 gfx::Size GetPreferredSize(); | 78 gfx::Size GetPreferredSize(); |
| 77 | 79 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 // Overridden from wm::WmSnapToPixelLayoutManager: | 133 // Overridden from wm::WmSnapToPixelLayoutManager: |
| 132 void OnWindowResized() override; | 134 void OnWindowResized() override; |
| 133 void SetChildBounds(aura::Window* child, | 135 void SetChildBounds(aura::Window* child, |
| 134 const gfx::Rect& requested_bounds) override; | 136 const gfx::Rect& requested_bounds) override; |
| 135 | 137 |
| 136 // Overridden from ShellObserver: | 138 // Overridden from ShellObserver: |
| 137 void OnShelfAutoHideBehaviorChanged(aura::Window* root_window) override; | 139 void OnShelfAutoHideBehaviorChanged(aura::Window* root_window) override; |
| 138 void OnPinnedStateChanged(aura::Window* pinned_window) override; | 140 void OnPinnedStateChanged(aura::Window* pinned_window) override; |
| 139 void OnVirtualKeyboardStateChanged(bool activated, | 141 void OnVirtualKeyboardStateChanged(bool activated, |
| 140 aura::Window* root_window) override; | 142 aura::Window* root_window) override; |
| 143 void OnAppListVisibilityChanged(bool shown, | |
| 144 aura::Window* root_window) override; | |
| 141 | 145 |
| 142 // Overridden from wm::ActivationChangeObserver: | 146 // Overridden from wm::ActivationChangeObserver: |
| 143 void OnWindowActivated(ActivationReason reason, | 147 void OnWindowActivated(ActivationReason reason, |
| 144 aura::Window* gained_active, | 148 aura::Window* gained_active, |
| 145 aura::Window* lost_active) override; | 149 aura::Window* lost_active) override; |
| 146 | 150 |
| 147 // Overridden from keyboard::KeyboardControllerObserver: | 151 // Overridden from keyboard::KeyboardControllerObserver: |
| 148 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 152 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
| 149 void OnKeyboardClosed() override; | 153 void OnKeyboardClosed() override; |
| 150 | 154 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 | 310 |
| 307 // Current state. | 311 // Current state. |
| 308 State state_; | 312 State state_; |
| 309 | 313 |
| 310 ShelfWidget* shelf_widget_; | 314 ShelfWidget* shelf_widget_; |
| 311 Shelf* shelf_; | 315 Shelf* shelf_; |
| 312 | 316 |
| 313 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. | 317 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. |
| 314 bool window_overlaps_shelf_; | 318 bool window_overlaps_shelf_; |
| 315 | 319 |
| 320 // Is the AppList being shown? This is maintained by | |
| 321 // OnAppListVisibilityChanged. | |
| 322 bool app_list_is_being_shown; | |
|
msw
2017/06/06 17:56:31
Add a trailing underscore and consider is_app_list
newcomer
2017/06/06 23:26:27
Done.
| |
| 323 | |
| 316 base::OneShotTimer auto_hide_timer_; | 324 base::OneShotTimer auto_hide_timer_; |
| 317 | 325 |
| 318 // 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. |
| 319 // 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. |
| 320 bool mouse_over_shelf_when_auto_hide_timer_started_; | 328 bool mouse_over_shelf_when_auto_hide_timer_started_; |
| 321 | 329 |
| 322 base::ObserverList<ShelfLayoutManagerObserver> observers_; | 330 base::ObserverList<ShelfLayoutManagerObserver> observers_; |
| 323 | 331 |
| 324 // The shelf reacts to gesture-drags, and can be set to auto-hide for certain | 332 // The shelf reacts to gesture-drags, and can be set to auto-hide for certain |
| 325 // gestures. Some shelf behaviour (e.g. visibility state, background color | 333 // gestures. Some shelf behaviour (e.g. visibility state, background color |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 365 keyboard::KeyboardControllerObserver> | 373 keyboard::KeyboardControllerObserver> |
| 366 keyboard_observer_; | 374 keyboard_observer_; |
| 367 ScopedSessionObserver scoped_session_observer_; | 375 ScopedSessionObserver scoped_session_observer_; |
| 368 | 376 |
| 369 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 377 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
| 370 }; | 378 }; |
| 371 | 379 |
| 372 } // namespace ash | 380 } // namespace ash |
| 373 | 381 |
| 374 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 382 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| OLD | NEW |