Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 2871243003: Enable new-virtual-keyboard-behavior flag by default. (Closed)
Patch Set: keep sorted the declarations Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); 131 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds);
132 wm::GetWindowState(child)->OnWMEvent(&event); 132 wm::GetWindowState(child)->OnWMEvent(&event);
133 UpdateShelfVisibility(); 133 UpdateShelfVisibility();
134 } 134 }
135 135
136 ////////////////////////////////////////////////////////////////////////////// 136 //////////////////////////////////////////////////////////////////////////////
137 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation: 137 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation:
138 138
139 void WorkspaceLayoutManager::OnKeyboardBoundsChanging( 139 void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
140 const gfx::Rect& new_bounds) { 140 const gfx::Rect& new_bounds) {
141 // If new window behavior flag enabled and in non-sticky mode, do not change 141 // If new window behavior is disable or the keyboard is in sticky mode, change
142 // the work area. 142 // the work area.
143 bool change_work_area = 143 const bool change_work_area =
144 (!base::CommandLine::ForCurrentProcess()->HasSwitch( 144 (base::CommandLine::ForCurrentProcess()->HasSwitch(
145 ::switches::kUseNewVirtualKeyboardBehavior) || 145 ::switches::kDisableNewVirtualKeyboardBehavior) ||
146 keyboard::KeyboardController::GetInstance()->keyboard_locked()); 146 (keyboard::KeyboardController::GetInstance() &&
147 keyboard::KeyboardController::GetInstance()->keyboard_locked()));
147 if (!change_work_area) 148 if (!change_work_area)
148 return; 149 return;
149 150
150 aura::Window* window = wm::GetActiveWindow(); 151 aura::Window* window = wm::GetActiveWindow();
151 if (!window) 152 if (!window)
152 return; 153 return;
153 154
154 window = window->GetToplevelWindow(); 155 window = window->GetToplevelWindow();
155 if (!window_->Contains(window)) 156 if (!window_->Contains(window))
156 return; 157 return;
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 for (aura::Window* window : windows) { 403 for (aura::Window* window : windows) {
403 wm::WindowState* window_state = wm::GetWindowState(window); 404 wm::WindowState* window_state = wm::GetWindowState(window);
404 if (window_on_top) 405 if (window_on_top)
405 window_state->DisableAlwaysOnTop(WmWindow::Get(window_on_top)); 406 window_state->DisableAlwaysOnTop(WmWindow::Get(window_on_top));
406 else 407 else
407 window_state->RestoreAlwaysOnTop(); 408 window_state->RestoreAlwaysOnTop();
408 } 409 }
409 } 410 }
410 411
411 } // namespace ash 412 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698