| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/session/session_state_observer.h" | 12 #include "ash/session/session_state_observer.h" |
| 13 #include "ash/shelf/background_animator.h" | 13 #include "ash/shelf/background_animator.h" |
| 14 #include "ash/shelf/shelf.h" | 14 #include "ash/shelf/shelf.h" |
| 15 #include "ash/shelf/shelf_types.h" | 15 #include "ash/shelf/shelf_types.h" |
| 16 #include "ash/shell_observer.h" | 16 #include "ash/shell_observer.h" |
| 17 #include "ash/snap_to_pixel_layout_manager.h" | 17 #include "ash/snap_to_pixel_layout_manager.h" |
| 18 #include "ash/system/status_area_widget.h" | 18 #include "ash/system/status_area_widget.h" |
| 19 #include "ash/wm/common/workspace/workspace_types.h" |
| 19 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 20 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
| 20 #include "ash/wm/lock_state_observer.h" | 21 #include "ash/wm/lock_state_observer.h" |
| 21 #include "ash/wm/workspace/workspace_types.h" | |
| 22 #include "base/compiler_specific.h" | 22 #include "base/compiler_specific.h" |
| 23 #include "base/gtest_prod_util.h" | 23 #include "base/gtest_prod_util.h" |
| 24 #include "base/logging.h" | 24 #include "base/logging.h" |
| 25 #include "base/macros.h" | 25 #include "base/macros.h" |
| 26 #include "base/observer_list.h" | 26 #include "base/observer_list.h" |
| 27 #include "base/timer/timer.h" | 27 #include "base/timer/timer.h" |
| 28 #include "ui/gfx/geometry/insets.h" | 28 #include "ui/gfx/geometry/insets.h" |
| 29 #include "ui/gfx/geometry/rect.h" | 29 #include "ui/gfx/geometry/rect.h" |
| 30 #include "ui/keyboard/keyboard_controller.h" | 30 #include "ui/keyboard/keyboard_controller.h" |
| 31 #include "ui/keyboard/keyboard_controller_observer.h" | 31 #include "ui/keyboard/keyboard_controller_observer.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 float opacity; | 232 float opacity; |
| 233 float status_opacity; | 233 float status_opacity; |
| 234 gfx::Rect shelf_bounds_in_root; | 234 gfx::Rect shelf_bounds_in_root; |
| 235 gfx::Rect shelf_bounds_in_shelf; | 235 gfx::Rect shelf_bounds_in_shelf; |
| 236 gfx::Rect status_bounds_in_shelf; | 236 gfx::Rect status_bounds_in_shelf; |
| 237 gfx::Insets work_area_insets; | 237 gfx::Insets work_area_insets; |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 struct State { | 240 struct State { |
| 241 State() : visibility_state(SHELF_VISIBLE), | 241 State() |
| 242 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), | 242 : visibility_state(SHELF_VISIBLE), |
| 243 window_state(WORKSPACE_WINDOW_STATE_DEFAULT), | 243 auto_hide_state(SHELF_AUTO_HIDE_HIDDEN), |
| 244 is_screen_locked(false), | 244 window_state(wm::WORKSPACE_WINDOW_STATE_DEFAULT), |
| 245 is_adding_user_screen(false) {} | 245 is_screen_locked(false), |
| 246 is_adding_user_screen(false) {} |
| 246 | 247 |
| 247 // Returns true if the two states are considered equal. As | 248 // Returns true if the two states are considered equal. As |
| 248 // |auto_hide_state| only matters if |visibility_state| is | 249 // |auto_hide_state| only matters if |visibility_state| is |
| 249 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as | 250 // |SHELF_AUTO_HIDE|, Equals() ignores the |auto_hide_state| as |
| 250 // appropriate. | 251 // appropriate. |
| 251 bool Equals(const State& other) const { | 252 bool Equals(const State& other) const { |
| 252 return other.visibility_state == visibility_state && | 253 return other.visibility_state == visibility_state && |
| 253 (visibility_state != SHELF_AUTO_HIDE || | 254 (visibility_state != SHELF_AUTO_HIDE || |
| 254 other.auto_hide_state == auto_hide_state) && | 255 other.auto_hide_state == auto_hide_state) && |
| 255 other.window_state == window_state && | 256 other.window_state == window_state && |
| 256 other.is_screen_locked == is_screen_locked && | 257 other.is_screen_locked == is_screen_locked && |
| 257 other.is_adding_user_screen == is_adding_user_screen; | 258 other.is_adding_user_screen == is_adding_user_screen; |
| 258 } | 259 } |
| 259 | 260 |
| 260 ShelfVisibilityState visibility_state; | 261 ShelfVisibilityState visibility_state; |
| 261 ShelfAutoHideState auto_hide_state; | 262 ShelfAutoHideState auto_hide_state; |
| 262 WorkspaceWindowState window_state; | 263 wm::WorkspaceWindowState window_state; |
| 263 bool is_screen_locked; | 264 bool is_screen_locked; |
| 264 bool is_adding_user_screen; | 265 bool is_adding_user_screen; |
| 265 }; | 266 }; |
| 266 | 267 |
| 267 // Sets the visibility of the shelf to |state|. | 268 // Sets the visibility of the shelf to |state|. |
| 268 void SetState(ShelfVisibilityState visibility_state); | 269 void SetState(ShelfVisibilityState visibility_state); |
| 269 | 270 |
| 270 // Updates the bounds and opacity of the shelf and status widgets. | 271 // Updates the bounds and opacity of the shelf and status widgets. |
| 271 // If |observer| is specified, it will be called back when the animations, if | 272 // If |observer| is specified, it will be called back when the animations, if |
| 272 // any, are complete. | 273 // any, are complete. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 397 |
| 397 // The show hide animation duration override or 0 for default. | 398 // The show hide animation duration override or 0 for default. |
| 398 int duration_override_in_ms_; | 399 int duration_override_in_ms_; |
| 399 | 400 |
| 400 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 401 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
| 401 }; | 402 }; |
| 402 | 403 |
| 403 } // namespace ash | 404 } // namespace ash |
| 404 | 405 |
| 405 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ | 406 #endif // ASH_SHELF_SHELF_LAYOUT_MANAGER_H_ |
| OLD | NEW |