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