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_state_observer.h" |
11 #include "ash/shelf/background_animator.h" | 12 #include "ash/shelf/background_animator.h" |
12 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
13 #include "ash/shelf/shelf_types.h" | 14 #include "ash/shelf/shelf_types.h" |
14 #include "ash/shell_observer.h" | 15 #include "ash/shell_observer.h" |
15 #include "ash/system/status_area_widget.h" | 16 #include "ash/system/status_area_widget.h" |
16 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 17 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
17 #include "ash/wm/lock_state_observer.h" | 18 #include "ash/wm/lock_state_observer.h" |
18 #include "ash/wm/workspace/workspace_types.h" | 19 #include "ash/wm/workspace/workspace_types.h" |
19 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
20 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // width of the status area. This allows the shelf to draw the background and | 54 // width of the status area. This allows the shelf to draw the background and |
54 // layout to the status area. | 55 // layout to the status area. |
55 // To respond to bounds changes in the status area StatusAreaLayoutManager works | 56 // To respond to bounds changes in the status area StatusAreaLayoutManager works |
56 // closely with ShelfLayoutManager. | 57 // closely with ShelfLayoutManager. |
57 class ASH_EXPORT ShelfLayoutManager : | 58 class ASH_EXPORT ShelfLayoutManager : |
58 public aura::LayoutManager, | 59 public aura::LayoutManager, |
59 public ash::ShellObserver, | 60 public ash::ShellObserver, |
60 public aura::client::ActivationChangeObserver, | 61 public aura::client::ActivationChangeObserver, |
61 public DockedWindowLayoutManagerObserver, | 62 public DockedWindowLayoutManagerObserver, |
62 public keyboard::KeyboardControllerObserver, | 63 public keyboard::KeyboardControllerObserver, |
63 public LockStateObserver { | 64 public LockStateObserver, |
| 65 public SessionStateObserver { |
64 public: | 66 public: |
65 | 67 |
66 // We reserve a small area on the edge of the workspace area to ensure that | 68 // We reserve a small area on the edge of the workspace area to ensure that |
67 // the resize handle at the edge of the window can be hit. | 69 // the resize handle at the edge of the window can be hit. |
68 static const int kWorkspaceAreaVisibleInset; | 70 static const int kWorkspaceAreaVisibleInset; |
69 | 71 |
70 // When autohidden we extend the touch hit target onto the screen so that the | 72 // When autohidden we extend the touch hit target onto the screen so that the |
71 // user can drag the shelf out. | 73 // user can drag the shelf out. |
72 static const int kWorkspaceAreaAutoHideInset; | 74 static const int kWorkspaceAreaAutoHideInset; |
73 | 75 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 virtual void OnMaximizeModeStarted() OVERRIDE; | 178 virtual void OnMaximizeModeStarted() OVERRIDE; |
177 virtual void OnMaximizeModeEnded() OVERRIDE; | 179 virtual void OnMaximizeModeEnded() OVERRIDE; |
178 | 180 |
179 // Overriden from aura::client::ActivationChangeObserver: | 181 // Overriden from aura::client::ActivationChangeObserver: |
180 virtual void OnWindowActivated(aura::Window* gained_active, | 182 virtual void OnWindowActivated(aura::Window* gained_active, |
181 aura::Window* lost_active) OVERRIDE; | 183 aura::Window* lost_active) OVERRIDE; |
182 | 184 |
183 // Overridden from ash::LockStateObserver: | 185 // Overridden from ash::LockStateObserver: |
184 virtual void OnLockStateEvent(LockStateObserver::EventType event) OVERRIDE; | 186 virtual void OnLockStateEvent(LockStateObserver::EventType event) OVERRIDE; |
185 | 187 |
| 188 // Overridden from ash::SessionStateObserver: |
| 189 virtual void SessionStateChanged( |
| 190 SessionStateDelegate::SessionState state) OVERRIDE; |
| 191 |
186 // TODO(harrym|oshima): These templates will be moved to | 192 // TODO(harrym|oshima): These templates will be moved to |
187 // new Shelf class. | 193 // new Shelf class. |
188 // A helper function that provides a shortcut for choosing | 194 // A helper function that provides a shortcut for choosing |
189 // values specific to a shelf alignment. | 195 // values specific to a shelf alignment. |
190 template<typename T> | 196 template<typename T> |
191 T SelectValueForShelfAlignment(T bottom, T left, T right, T top) const { | 197 T SelectValueForShelfAlignment(T bottom, T left, T right, T top) const { |
192 switch (GetAlignment()) { | 198 switch (GetAlignment()) { |
193 case SHELF_ALIGNMENT_BOTTOM: | 199 case SHELF_ALIGNMENT_BOTTOM: |
194 return bottom; | 200 return bottom; |
195 case SHELF_ALIGNMENT_LEFT: | 201 case SHELF_ALIGNMENT_LEFT: |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 407 |
402 // The show hide animation duration override or 0 for default. | 408 // The show hide animation duration override or 0 for default. |
403 int duration_override_in_ms_; | 409 int duration_override_in_ms_; |
404 | 410 |
405 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 411 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
406 }; | 412 }; |
407 | 413 |
408 } // namespace ash | 414 } // namespace ash |
409 | 415 |
410 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 416 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |