Index: ash/shelf/shelf_layout_manager.cc |
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
index 19deab0a039b3bbec21e718d8e84468befbb781a..de2340951ba936934db0b11b5176f0517d2940cb 100644 |
--- a/ash/shelf/shelf_layout_manager.cc |
+++ b/ash/shelf/shelf_layout_manager.cc |
@@ -432,9 +432,10 @@ void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { |
// If new window behavior flag enabled and in non-sticky mode, do not change |
// the work area. |
bool change_work_area = |
- (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
- ::switches::kUseNewVirtualKeyboardBehavior) || |
- keyboard::KeyboardController::GetInstance()->keyboard_locked()); |
+ (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ ::switches::kDisableNewVirtualKeyboardBehavior) || |
+ (keyboard::KeyboardController::GetInstance() && |
+ keyboard::KeyboardController::GetInstance()->keyboard_locked())); |
keyboard_bounds_ = new_bounds; |
LayoutShelfAndUpdateBounds(change_work_area); |