OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/session/session_state_observer.h" | 11 #include "ash/session/session_state_observer.h" |
12 #include "ash/shelf/background_animator.h" | 12 #include "ash/shelf/background_animator.h" |
13 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
14 #include "ash/shelf/shelf_types.h" | 14 #include "ash/shelf/shelf_types.h" |
15 #include "ash/shell_observer.h" | 15 #include "ash/shell_observer.h" |
| 16 #include "ash/snap_to_pixel_layout_manager.h" |
16 #include "ash/system/status_area_widget.h" | 17 #include "ash/system/status_area_widget.h" |
17 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 18 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
18 #include "ash/wm/lock_state_observer.h" | 19 #include "ash/wm/lock_state_observer.h" |
19 #include "ash/wm/workspace/workspace_types.h" | 20 #include "ash/wm/workspace/workspace_types.h" |
20 #include "base/basictypes.h" | 21 #include "base/basictypes.h" |
21 #include "base/compiler_specific.h" | 22 #include "base/compiler_specific.h" |
22 #include "base/logging.h" | 23 #include "base/logging.h" |
23 #include "base/observer_list.h" | 24 #include "base/observer_list.h" |
24 #include "base/timer/timer.h" | 25 #include "base/timer/timer.h" |
25 #include "ui/aura/layout_manager.h" | |
26 #include "ui/gfx/insets.h" | 26 #include "ui/gfx/insets.h" |
27 #include "ui/gfx/rect.h" | 27 #include "ui/gfx/rect.h" |
28 #include "ui/keyboard/keyboard_controller.h" | 28 #include "ui/keyboard/keyboard_controller.h" |
29 #include "ui/keyboard/keyboard_controller_observer.h" | 29 #include "ui/keyboard/keyboard_controller_observer.h" |
30 #include "ui/wm/public/activation_change_observer.h" | 30 #include "ui/wm/public/activation_change_observer.h" |
31 | 31 |
32 namespace aura { | 32 namespace aura { |
33 class RootWindow; | 33 class RootWindow; |
34 } | 34 } |
35 | 35 |
(...skipping 13 matching lines...) Expand all Loading... |
49 class WorkspaceController; | 49 class WorkspaceController; |
50 FORWARD_DECLARE_TEST(AshPopupAlignmentDelegateTest, AutoHide); | 50 FORWARD_DECLARE_TEST(AshPopupAlignmentDelegateTest, AutoHide); |
51 FORWARD_DECLARE_TEST(WebNotificationTrayTest, PopupAndFullscreen); | 51 FORWARD_DECLARE_TEST(WebNotificationTrayTest, PopupAndFullscreen); |
52 | 52 |
53 // ShelfLayoutManager is the layout manager responsible for the shelf and | 53 // ShelfLayoutManager is the layout manager responsible for the shelf and |
54 // status widgets. The shelf is given the total available width and told the | 54 // status widgets. The shelf is given the total available width and told the |
55 // width of the status area. This allows the shelf to draw the background and | 55 // width of the status area. This allows the shelf to draw the background and |
56 // layout to the status area. | 56 // layout to the status area. |
57 // To respond to bounds changes in the status area StatusAreaLayoutManager works | 57 // To respond to bounds changes in the status area StatusAreaLayoutManager works |
58 // closely with ShelfLayoutManager. | 58 // closely with ShelfLayoutManager. |
59 class ASH_EXPORT ShelfLayoutManager : | 59 class ASH_EXPORT ShelfLayoutManager |
60 public aura::LayoutManager, | 60 : public ash::ShellObserver, |
61 public ash::ShellObserver, | 61 public aura::client::ActivationChangeObserver, |
62 public aura::client::ActivationChangeObserver, | 62 public DockedWindowLayoutManagerObserver, |
63 public DockedWindowLayoutManagerObserver, | 63 public keyboard::KeyboardControllerObserver, |
64 public keyboard::KeyboardControllerObserver, | 64 public LockStateObserver, |
65 public LockStateObserver, | 65 public SnapToPixelLayoutManager, |
66 public SessionStateObserver { | 66 public SessionStateObserver { |
67 public: | 67 public: |
68 | 68 |
69 // We reserve a small area on the edge of the workspace area to ensure that | 69 // We reserve a small area on the edge of the workspace area to ensure that |
70 // the resize handle at the edge of the window can be hit. | 70 // the resize handle at the edge of the window can be hit. |
71 static const int kWorkspaceAreaVisibleInset; | 71 static const int kWorkspaceAreaVisibleInset; |
72 | 72 |
73 // When autohidden we extend the touch hit target onto the screen so that the | 73 // When autohidden we extend the touch hit target onto the screen so that the |
74 // user can drag the shelf out. | 74 // user can drag the shelf out. |
75 static const int kWorkspaceAreaAutoHideInset; | 75 static const int kWorkspaceAreaAutoHideInset; |
76 | 76 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Returns DRAG_TRAY if the gesture can start dragging the tray-bubble from | 157 // Returns DRAG_TRAY if the gesture can start dragging the tray-bubble from |
158 // this point on. | 158 // this point on. |
159 DragState UpdateGestureDrag(const ui::GestureEvent& gesture); | 159 DragState UpdateGestureDrag(const ui::GestureEvent& gesture); |
160 void CompleteGestureDrag(const ui::GestureEvent& gesture); | 160 void CompleteGestureDrag(const ui::GestureEvent& gesture); |
161 void CancelGestureDrag(); | 161 void CancelGestureDrag(); |
162 | 162 |
163 // Set an animation duration override for the show / hide animation of the | 163 // Set an animation duration override for the show / hide animation of the |
164 // shelf. Specifying 0 leads to use the default. | 164 // shelf. Specifying 0 leads to use the default. |
165 void SetAnimationDurationOverride(int duration_override_in_ms); | 165 void SetAnimationDurationOverride(int duration_override_in_ms); |
166 | 166 |
167 // Overridden from aura::LayoutManager: | 167 // Overridden from SnapLayoutManager: |
168 virtual void OnWindowResized() OVERRIDE; | 168 virtual void OnWindowResized() OVERRIDE; |
169 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | |
170 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | |
171 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | |
172 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | |
173 bool visible) OVERRIDE; | |
174 virtual void SetChildBounds(aura::Window* child, | 169 virtual void SetChildBounds(aura::Window* child, |
175 const gfx::Rect& requested_bounds) OVERRIDE; | 170 const gfx::Rect& requested_bounds) OVERRIDE; |
176 | 171 |
177 // Overridden from ash::ShellObserver: | 172 // Overridden from ash::ShellObserver: |
178 virtual void OnLockStateChanged(bool locked) OVERRIDE; | 173 virtual void OnLockStateChanged(bool locked) OVERRIDE; |
179 virtual void OnMaximizeModeStarted() OVERRIDE; | 174 virtual void OnMaximizeModeStarted() OVERRIDE; |
180 | 175 |
181 // Overriden from aura::client::ActivationChangeObserver: | 176 // Overriden from aura::client::ActivationChangeObserver: |
182 virtual void OnWindowActivated(aura::Window* gained_active, | 177 virtual void OnWindowActivated(aura::Window* gained_active, |
183 aura::Window* lost_active) OVERRIDE; | 178 aura::Window* lost_active) OVERRIDE; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 395 |
401 // The show hide animation duration override or 0 for default. | 396 // The show hide animation duration override or 0 for default. |
402 int duration_override_in_ms_; | 397 int duration_override_in_ms_; |
403 | 398 |
404 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 399 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
405 }; | 400 }; |
406 | 401 |
407 } // namespace ash | 402 } // namespace ash |
408 | 403 |
409 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 404 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |