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 #include "ash/common/shelf/shelf_layout_manager.h" | 5 #include "ash/common/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/common/material_design/material_design_controller.h" | 11 #include "ash/common/material_design/material_design_controller.h" |
12 #include "ash/common/session/session_state_delegate.h" | 12 #include "ash/common/session/session_state_delegate.h" |
13 #include "ash/common/shelf/shelf_constants.h" | 13 #include "ash/common/shelf/shelf_constants.h" |
14 #include "ash/common/shelf/shelf_layout_manager_observer.h" | 14 #include "ash/common/shelf/shelf_layout_manager_observer.h" |
15 #include "ash/common/shelf/wm_shelf.h" | 15 #include "ash/common/shelf/wm_shelf.h" |
16 #include "ash/common/shelf/wm_shelf_util.h" | 16 #include "ash/common/shelf/wm_shelf_util.h" |
17 #include "ash/common/system/status_area_widget.h" | 17 #include "ash/common/system/status_area_widget.h" |
18 #include "ash/common/wm/fullscreen_window_finder.h" | 18 #include "ash/common/wm/fullscreen_window_finder.h" |
19 #include "ash/common/wm/mru_window_tracker.h" | 19 #include "ash/common/wm/mru_window_tracker.h" |
20 #include "ash/common/wm/window_state.h" | 20 #include "ash/common/wm/window_state.h" |
21 #include "ash/common/wm/wm_screen_util.h" | 21 #include "ash/common/wm/wm_screen_util.h" |
22 #include "ash/common/wm_lookup.h" | 22 #include "ash/common/wm_lookup.h" |
23 #include "ash/common/wm_root_window_controller.h" | |
24 #include "ash/common/wm_shell.h" | 23 #include "ash/common/wm_shell.h" |
25 #include "ash/common/wm_window.h" | 24 #include "ash/common/wm_window.h" |
26 #include "ash/public/cpp/shell_window_ids.h" | 25 #include "ash/public/cpp/shell_window_ids.h" |
| 26 #include "ash/root_window_controller.h" |
27 #include "base/auto_reset.h" | 27 #include "base/auto_reset.h" |
28 #include "base/command_line.h" | 28 #include "base/command_line.h" |
29 #include "base/i18n/rtl.h" | 29 #include "base/i18n/rtl.h" |
30 #include "ui/base/ui_base_switches.h" | 30 #include "ui/base/ui_base_switches.h" |
31 #include "ui/compositor/layer.h" | 31 #include "ui/compositor/layer.h" |
32 #include "ui/compositor/layer_animation_observer.h" | 32 #include "ui/compositor/layer_animation_observer.h" |
33 #include "ui/compositor/layer_animator.h" | 33 #include "ui/compositor/layer_animator.h" |
34 #include "ui/compositor/scoped_layer_animation_settings.h" | 34 #include "ui/compositor/scoped_layer_animation_settings.h" |
35 #include "ui/display/display.h" | 35 #include "ui/display/display.h" |
36 #include "ui/display/screen.h" | 36 #include "ui/display/screen.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 : opacity(0.0f), status_opacity(0.0f) {} | 445 : opacity(0.0f), status_opacity(0.0f) {} |
446 | 446 |
447 ShelfLayoutManager::TargetBounds::~TargetBounds() {} | 447 ShelfLayoutManager::TargetBounds::~TargetBounds() {} |
448 | 448 |
449 void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) { | 449 void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) { |
450 State state; | 450 State state; |
451 state.visibility_state = visibility_state; | 451 state.visibility_state = visibility_state; |
452 state.auto_hide_state = CalculateAutoHideState(visibility_state); | 452 state.auto_hide_state = CalculateAutoHideState(visibility_state); |
453 | 453 |
454 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(shelf_widget_); | 454 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(shelf_widget_); |
455 WmRootWindowController* controller = shelf_window->GetRootWindowController(); | 455 RootWindowController* controller = shelf_window->GetRootWindowController(); |
456 state.window_state = controller ? controller->GetWorkspaceWindowState() | 456 state.window_state = controller ? controller->GetWorkspaceWindowState() |
457 : wm::WORKSPACE_WINDOW_STATE_DEFAULT; | 457 : wm::WORKSPACE_WINDOW_STATE_DEFAULT; |
458 // Preserve the log in screen states. | 458 // Preserve the log in screen states. |
459 state.is_adding_user_screen = state_.is_adding_user_screen; | 459 state.is_adding_user_screen = state_.is_adding_user_screen; |
460 state.is_screen_locked = state_.is_screen_locked; | 460 state.is_screen_locked = state_.is_screen_locked; |
461 | 461 |
462 // Force an update because gesture drags affect the shelf bounds and we | 462 // Force an update because gesture drags affect the shelf bounds and we |
463 // should animate back to the normal bounds at the end of a gesture. | 463 // should animate back to the normal bounds at the end of a gesture. |
464 bool force_update = | 464 bool force_update = |
465 (gesture_drag_status_ == GESTURE_DRAG_CANCEL_IN_PROGRESS || | 465 (gesture_drag_status_ == GESTURE_DRAG_CANCEL_IN_PROGRESS || |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1099 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1100 } | 1100 } |
1101 | 1101 |
1102 void ShelfLayoutManager::CancelGestureDrag() { | 1102 void ShelfLayoutManager::CancelGestureDrag() { |
1103 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1103 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
1104 UpdateVisibilityState(); | 1104 UpdateVisibilityState(); |
1105 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1105 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1106 } | 1106 } |
1107 | 1107 |
1108 } // namespace ash | 1108 } // namespace ash |
OLD | NEW |