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_WM_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_SHELF_LAYOUT_MANAGER_H_ |
6 #define ASH_WM_SHELF_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_SHELF_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/launcher/launcher.h" | 9 #include "ash/launcher/launcher.h" |
10 #include "ash/shell_observer.h" | 10 #include "ash/shell_observer.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace views { | 26 namespace views { |
27 class Widget; | 27 class Widget; |
28 } | 28 } |
29 | 29 |
30 namespace ash { | 30 namespace ash { |
31 class ScreenAsh; | 31 class ScreenAsh; |
32 namespace internal { | 32 namespace internal { |
33 | 33 |
34 class ShelfLayoutManagerTest; | 34 class ShelfLayoutManagerTest; |
35 class WorkspaceManager; | 35 class WorkspaceController; |
36 | 36 |
37 // ShelfLayoutManager is the layout manager responsible for the launcher and | 37 // ShelfLayoutManager is the layout manager responsible for the launcher and |
38 // status widgets. The launcher is given the total available width and told the | 38 // status widgets. The launcher is given the total available width and told the |
39 // width of the status area. This allows the launcher to draw the background and | 39 // width of the status area. This allows the launcher to draw the background and |
40 // layout to the status area. | 40 // layout to the status area. |
41 // To respond to bounds changes in the status area StatusAreaLayoutManager works | 41 // To respond to bounds changes in the status area StatusAreaLayoutManager works |
42 // closely with ShelfLayoutManager. | 42 // closely with ShelfLayoutManager. |
43 class ASH_EXPORT ShelfLayoutManager : | 43 class ASH_EXPORT ShelfLayoutManager : |
44 public aura::LayoutManager, | 44 public aura::LayoutManager, |
45 public ash::ShellObserver, | 45 public ash::ShellObserver, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior); | 91 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior); |
92 ShelfAutoHideBehavior auto_hide_behavior() const { | 92 ShelfAutoHideBehavior auto_hide_behavior() const { |
93 return auto_hide_behavior_; | 93 return auto_hide_behavior_; |
94 } | 94 } |
95 | 95 |
96 // Sets the alignment. Returns true if the alignment is changed. Otherwise, | 96 // Sets the alignment. Returns true if the alignment is changed. Otherwise, |
97 // returns false. | 97 // returns false. |
98 bool SetAlignment(ShelfAlignment alignment); | 98 bool SetAlignment(ShelfAlignment alignment); |
99 ShelfAlignment alignment() const { return alignment_; } | 99 ShelfAlignment alignment() const { return alignment_; } |
100 | 100 |
101 void set_workspace_manager(WorkspaceManager* manager) { | 101 void set_workspace_controller(WorkspaceController* controller) { |
102 workspace_manager_ = manager; | 102 workspace_controller_ = controller; |
103 } | 103 } |
104 | 104 |
105 views::Widget* launcher_widget() { | 105 views::Widget* launcher_widget() { |
106 return launcher_ ? launcher_->widget() : NULL; | 106 return launcher_ ? launcher_->widget() : NULL; |
107 } | 107 } |
108 const views::Widget* launcher_widget() const { | 108 const views::Widget* launcher_widget() const { |
109 return launcher_ ? launcher_->widget() : NULL; | 109 return launcher_ ? launcher_->widget() : NULL; |
110 } | 110 } |
111 views::Widget* status() { return status_; } | 111 views::Widget* status() { return status_; } |
112 | 112 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 ShelfAutoHideBehavior auto_hide_behavior_; | 254 ShelfAutoHideBehavior auto_hide_behavior_; |
255 | 255 |
256 ShelfAlignment alignment_; | 256 ShelfAlignment alignment_; |
257 | 257 |
258 // Current state. | 258 // Current state. |
259 State state_; | 259 State state_; |
260 | 260 |
261 Launcher* launcher_; | 261 Launcher* launcher_; |
262 views::Widget* status_; | 262 views::Widget* status_; |
263 | 263 |
264 WorkspaceManager* workspace_manager_; | 264 WorkspaceController* workspace_controller_; |
265 | 265 |
266 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. | 266 // Do any windows overlap the shelf? This is maintained by WorkspaceManager. |
267 bool window_overlaps_shelf_; | 267 bool window_overlaps_shelf_; |
268 | 268 |
269 base::OneShotTimer<ShelfLayoutManager> auto_hide_timer_; | 269 base::OneShotTimer<ShelfLayoutManager> auto_hide_timer_; |
270 | 270 |
271 // EventFilter used to detect when user moves the mouse over the launcher to | 271 // EventFilter used to detect when user moves the mouse over the launcher to |
272 // trigger showing the launcher. | 272 // trigger showing the launcher. |
273 scoped_ptr<AutoHideEventFilter> event_filter_; | 273 scoped_ptr<AutoHideEventFilter> event_filter_; |
274 | 274 |
275 ObserverList<Observer> observers_; | 275 ObserverList<Observer> observers_; |
276 | 276 |
277 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 277 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
278 }; | 278 }; |
279 | 279 |
280 } // namespace internal | 280 } // namespace internal |
281 } // namespace ash | 281 } // namespace ash |
282 | 282 |
283 #endif // ASH_WM_SHELF_LAYOUT_MANAGER_H_ | 283 #endif // ASH_WM_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |