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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/keyboard/keyboard_observer_register.h" | 9 #include "ash/keyboard/keyboard_observer_register.h" |
10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); | 133 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); |
134 wm::GetWindowState(child)->OnWMEvent(&event); | 134 wm::GetWindowState(child)->OnWMEvent(&event); |
135 UpdateShelfVisibility(); | 135 UpdateShelfVisibility(); |
136 } | 136 } |
137 | 137 |
138 ////////////////////////////////////////////////////////////////////////////// | 138 ////////////////////////////////////////////////////////////////////////////// |
139 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation: | 139 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation: |
140 | 140 |
141 void WorkspaceLayoutManager::OnKeyboardBoundsChanging( | 141 void WorkspaceLayoutManager::OnKeyboardBoundsChanging( |
142 const gfx::Rect& new_bounds) { | 142 const gfx::Rect& new_bounds) { |
143 // If new window behavior flag enabled and in non-sticky mode, do not change | 143 // If new window behavior is disable or the keyboard is in sticky mode, change |
144 // the work area. | 144 // the work area. |
145 bool change_work_area = | 145 const bool change_work_area = |
146 (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 146 (base::CommandLine::ForCurrentProcess()->HasSwitch( |
147 ::switches::kUseNewVirtualKeyboardBehavior) || | 147 ::switches::kDisableNewVirtualKeyboardBehavior) || |
148 keyboard::KeyboardController::GetInstance()->keyboard_locked()); | 148 (keyboard::KeyboardController::GetInstance() && |
| 149 keyboard::KeyboardController::GetInstance()->keyboard_locked())); |
149 if (!change_work_area) | 150 if (!change_work_area) |
150 return; | 151 return; |
151 | 152 |
152 aura::Window* window = wm::GetActiveWindow(); | 153 aura::Window* window = wm::GetActiveWindow(); |
153 if (!window) | 154 if (!window) |
154 return; | 155 return; |
155 | 156 |
156 window = window->GetToplevelWindow(); | 157 window = window->GetToplevelWindow(); |
157 if (!window_->Contains(window)) | 158 if (!window_->Contains(window)) |
158 return; | 159 return; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 for (aura::Window* window : windows) { | 404 for (aura::Window* window : windows) { |
404 wm::WindowState* window_state = wm::GetWindowState(window); | 405 wm::WindowState* window_state = wm::GetWindowState(window); |
405 if (window_on_top) | 406 if (window_on_top) |
406 window_state->DisableAlwaysOnTop(WmWindow::Get(window_on_top)); | 407 window_state->DisableAlwaysOnTop(WmWindow::Get(window_on_top)); |
407 else | 408 else |
408 window_state->RestoreAlwaysOnTop(); | 409 window_state->RestoreAlwaysOnTop(); |
409 } | 410 } |
410 } | 411 } |
411 | 412 |
412 } // namespace ash | 413 } // namespace ash |
OLD | NEW |