| 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/shelf/shelf_layout_manager.h" | 5 #include "ash/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/ash_switches.h" | |
| 12 #include "ash/common/material_design/material_design_controller.h" | 11 #include "ash/common/material_design/material_design_controller.h" |
| 13 #include "ash/common/session/session_state_delegate.h" | 12 #include "ash/common/session/session_state_delegate.h" |
| 14 #include "ash/common/shelf/shelf_constants.h" | 13 #include "ash/common/shelf/shelf_constants.h" |
| 15 #include "ash/common/shelf/shelf_delegate.h" | 14 #include "ash/common/shelf/shelf_delegate.h" |
| 16 #include "ash/common/shelf/wm_shelf_util.h" | 15 #include "ash/common/shelf/wm_shelf_util.h" |
| 17 #include "ash/common/shell_window_ids.h" | 16 #include "ash/common/shell_window_ids.h" |
| 18 #include "ash/common/system/status_area_widget.h" | 17 #include "ash/common/system/status_area_widget.h" |
| 19 #include "ash/common/wm/fullscreen_window_finder.h" | 18 #include "ash/common/wm/fullscreen_window_finder.h" |
| 20 #include "ash/common/wm/mru_window_tracker.h" | 19 #include "ash/common/wm/mru_window_tracker.h" |
| 21 #include "ash/common/wm/window_state.h" | 20 #include "ash/common/wm/window_state.h" |
| 22 #include "ash/common/wm/wm_screen_util.h" | 21 #include "ash/common/wm/wm_screen_util.h" |
| 23 #include "ash/common/wm_lookup.h" | 22 #include "ash/common/wm_lookup.h" |
| 24 #include "ash/common/wm_root_window_controller.h" | 23 #include "ash/common/wm_root_window_controller.h" |
| 25 #include "ash/common/wm_root_window_controller_observer.h" | 24 #include "ash/common/wm_root_window_controller_observer.h" |
| 26 #include "ash/common/wm_shell.h" | 25 #include "ash/common/wm_shell.h" |
| 27 #include "ash/common/wm_window.h" | 26 #include "ash/common/wm_window.h" |
| 28 #include "ash/shelf/shelf.h" | 27 #include "ash/shelf/shelf.h" |
| 29 #include "ash/shelf/shelf_layout_manager_observer.h" | 28 #include "ash/shelf/shelf_layout_manager_observer.h" |
| 30 #include "base/auto_reset.h" | 29 #include "base/auto_reset.h" |
| 31 #include "base/command_line.h" | 30 #include "base/command_line.h" |
| 32 #include "base/i18n/rtl.h" | 31 #include "base/i18n/rtl.h" |
| 32 #include "ui/base/ui_base_switches.h" |
| 33 #include "ui/compositor/layer.h" | 33 #include "ui/compositor/layer.h" |
| 34 #include "ui/compositor/layer_animation_observer.h" | 34 #include "ui/compositor/layer_animation_observer.h" |
| 35 #include "ui/compositor/layer_animator.h" | 35 #include "ui/compositor/layer_animator.h" |
| 36 #include "ui/compositor/scoped_layer_animation_settings.h" | 36 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 37 #include "ui/display/display.h" | 37 #include "ui/display/display.h" |
| 38 #include "ui/display/screen.h" | 38 #include "ui/display/screen.h" |
| 39 #include "ui/events/event.h" | 39 #include "ui/events/event.h" |
| 40 #include "ui/events/event_handler.h" | 40 #include "ui/events/event_handler.h" |
| 41 #include "ui/keyboard/keyboard_controller.h" | 41 #include "ui/keyboard/keyboard_controller.h" |
| 42 #include "ui/keyboard/keyboard_util.h" | 42 #include "ui/keyboard/keyboard_util.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 420 } |
| 421 | 421 |
| 422 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { | 422 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { |
| 423 bool keyboard_is_about_to_hide = false; | 423 bool keyboard_is_about_to_hide = false; |
| 424 if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) | 424 if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) |
| 425 keyboard_is_about_to_hide = true; | 425 keyboard_is_about_to_hide = true; |
| 426 // If new window behavior flag enabled and in non-sticky mode, do not change | 426 // If new window behavior flag enabled and in non-sticky mode, do not change |
| 427 // the work area. | 427 // the work area. |
| 428 bool change_work_area = | 428 bool change_work_area = |
| 429 (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 429 (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 430 switches::kAshUseNewVKWindowBehavior) || | 430 ::switches::kUseNewVKWindowBehavior) || |
| 431 keyboard::KeyboardController::GetInstance()->get_lock_keyboard()); | 431 keyboard::KeyboardController::GetInstance()->get_lock_keyboard()); |
| 432 | 432 |
| 433 keyboard_bounds_ = new_bounds; | 433 keyboard_bounds_ = new_bounds; |
| 434 LayoutShelfAndUpdateBounds(change_work_area); | 434 LayoutShelfAndUpdateBounds(change_work_area); |
| 435 | 435 |
| 436 // On login screen if keyboard has been just hidden, update bounds just once | 436 // On login screen if keyboard has been just hidden, update bounds just once |
| 437 // but ignore target_bounds.work_area_insets since shelf overlaps with login | 437 // but ignore target_bounds.work_area_insets since shelf overlaps with login |
| 438 // window. | 438 // window. |
| 439 if (WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked() && | 439 if (WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked() && |
| 440 keyboard_is_about_to_hide) { | 440 keyboard_is_about_to_hide) { |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1150 gesture_drag_status_ = GESTURE_DRAG_NONE; |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 void ShelfLayoutManager::CancelGestureDrag() { | 1153 void ShelfLayoutManager::CancelGestureDrag() { |
| 1154 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1154 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
| 1155 UpdateVisibilityState(); | 1155 UpdateVisibilityState(); |
| 1156 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1156 gesture_drag_status_ = GESTURE_DRAG_NONE; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 } // namespace ash | 1159 } // namespace ash |
| OLD | NEW |