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" |
11 #include "ash/common/session/session_state_observer.h" | 11 #include "ash/common/session/session_state_observer.h" |
12 #include "ash/common/shelf/wm_shelf.h" | 12 #include "ash/common/shelf/wm_shelf.h" |
13 #include "ash/common/shell_observer.h" | 13 #include "ash/common/shell_observer.h" |
14 #include "ash/common/wm/background_animator.h" | |
15 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" | 14 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" |
16 #include "ash/common/wm/lock_state_observer.h" | 15 #include "ash/common/wm/lock_state_observer.h" |
17 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" | 16 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" |
18 #include "ash/common/wm/workspace/workspace_types.h" | 17 #include "ash/common/wm/workspace/workspace_types.h" |
19 #include "ash/common/wm_activation_observer.h" | 18 #include "ash/common/wm_activation_observer.h" |
20 #include "ash/public/cpp/shelf_types.h" | 19 #include "ash/public/cpp/shelf_types.h" |
21 #include "base/macros.h" | 20 #include "base/macros.h" |
22 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
23 #include "base/timer/timer.h" | 22 #include "base/timer/timer.h" |
24 #include "ui/gfx/geometry/insets.h" | 23 #include "ui/gfx/geometry/insets.h" |
25 #include "ui/gfx/geometry/rect.h" | 24 #include "ui/gfx/geometry/rect.h" |
26 #include "ui/keyboard/keyboard_controller_observer.h" | 25 #include "ui/keyboard/keyboard_controller_observer.h" |
27 | 26 |
28 namespace ui { | 27 namespace ui { |
29 class ImplicitAnimationObserver; | 28 class ImplicitAnimationObserver; |
30 class MouseEvent; | 29 class MouseEvent; |
31 } | 30 } |
32 | 31 |
33 namespace ash { | 32 namespace ash { |
34 | 33 |
| 34 enum class AnimationChangeType; |
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 class WmShelf; |
40 | 40 |
41 // ShelfLayoutManager is the layout manager responsible for the shelf and | 41 // ShelfLayoutManager is the layout manager responsible for the shelf and |
42 // 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 |
43 // 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 |
44 // layout to the status area. | 44 // layout to the status area. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 void StopAnimating(); | 235 void StopAnimating(); |
236 | 236 |
237 // Calculates the target bounds assuming visibility of |visible|. | 237 // Calculates the target bounds assuming visibility of |visible|. |
238 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds); | 238 void CalculateTargetBounds(const State& state, TargetBounds* target_bounds); |
239 | 239 |
240 // Updates the target bounds if a gesture-drag is in progress. This is only | 240 // Updates the target bounds if a gesture-drag is in progress. This is only |
241 // used by |CalculateTargetBounds()|. | 241 // used by |CalculateTargetBounds()|. |
242 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const; | 242 void UpdateTargetBoundsForGesture(TargetBounds* target_bounds) const; |
243 | 243 |
244 // Updates the background of the shelf if it has changed. | 244 // Updates the background of the shelf if it has changed. |
245 void MaybeUpdateShelfBackground(BackgroundAnimatorChangeType change_type); | 245 void MaybeUpdateShelfBackground(AnimationChangeType change_type); |
246 | 246 |
247 // Updates the auto hide state immediately. | 247 // Updates the auto hide state immediately. |
248 void UpdateAutoHideStateNow(); | 248 void UpdateAutoHideStateNow(); |
249 | 249 |
250 // Stops the auto hide timer and clears | 250 // Stops the auto hide timer and clears |
251 // |mouse_over_shelf_when_auto_hide_timer_started_|. | 251 // |mouse_over_shelf_when_auto_hide_timer_started_|. |
252 void StopAutoHideTimer(); | 252 void StopAutoHideTimer(); |
253 | 253 |
254 // Returns the bounds of an additional region which can trigger showing the | 254 // Returns the bounds of an additional region which can trigger showing the |
255 // shelf. This region exists to make it easier to trigger showing the shelf | 255 // shelf. This region exists to make it easier to trigger showing the shelf |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // The current shelf background. Should not be assigned to directly, use | 356 // The current shelf background. Should not be assigned to directly, use |
357 // MaybeUpdateShelfBackground() instead. | 357 // MaybeUpdateShelfBackground() instead. |
358 ShelfBackgroundType shelf_background_type_; | 358 ShelfBackgroundType shelf_background_type_; |
359 | 359 |
360 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 360 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
361 }; | 361 }; |
362 | 362 |
363 } // namespace ash | 363 } // namespace ash |
364 | 364 |
365 #endif // ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ | 365 #endif // ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |