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 |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 UpdateAutoHideStateNow(); | 426 UpdateAutoHideStateNow(); |
427 } | 427 } |
428 | 428 |
429 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { | 429 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { |
430 bool keyboard_is_about_to_hide = false; | 430 bool keyboard_is_about_to_hide = false; |
431 if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) | 431 if (new_bounds.IsEmpty() && !keyboard_bounds_.IsEmpty()) |
432 keyboard_is_about_to_hide = true; | 432 keyboard_is_about_to_hide = true; |
433 // If new window behavior flag enabled and in non-sticky mode, do not change | 433 // If new window behavior flag enabled and in non-sticky mode, do not change |
434 // the work area. | 434 // the work area. |
435 bool change_work_area = | 435 bool change_work_area = |
436 (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 436 (base::CommandLine::ForCurrentProcess()->HasSwitch( |
437 ::switches::kUseNewVirtualKeyboardBehavior) || | 437 ::switches::kDisableNewVirtualKeyboardBehavior) || |
438 keyboard::KeyboardController::GetInstance()->keyboard_locked()); | 438 (keyboard::KeyboardController::GetInstance() && |
| 439 keyboard::KeyboardController::GetInstance()->keyboard_locked())); |
439 | 440 |
440 keyboard_bounds_ = new_bounds; | 441 keyboard_bounds_ = new_bounds; |
441 LayoutShelfAndUpdateBounds(change_work_area); | 442 LayoutShelfAndUpdateBounds(change_work_area); |
442 | 443 |
443 // On login screen if keyboard has been just hidden, update bounds just once | 444 // On login screen if keyboard has been just hidden, update bounds just once |
444 // but ignore target_bounds.work_area_insets since shelf overlaps with login | 445 // but ignore target_bounds.work_area_insets since shelf overlaps with login |
445 // window. | 446 // window. |
446 if (Shell::Get()->session_controller()->IsUserSessionBlocked() && | 447 if (Shell::Get()->session_controller()->IsUserSessionBlocked() && |
447 keyboard_is_about_to_hide) { | 448 keyboard_is_about_to_hide) { |
448 WmWindow* window = WmWindow::Get(shelf_widget_->GetNativeWindow()); | 449 WmWindow* window = WmWindow::Get(shelf_widget_->GetNativeWindow()); |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1144 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1144 } | 1145 } |
1145 | 1146 |
1146 void ShelfLayoutManager::CancelGestureDrag() { | 1147 void ShelfLayoutManager::CancelGestureDrag() { |
1147 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1148 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
1148 UpdateVisibilityState(); | 1149 UpdateVisibilityState(); |
1149 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1150 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1150 } | 1151 } |
1151 | 1152 |
1152 } // namespace ash | 1153 } // namespace ash |
OLD | NEW |