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

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

Issue 2180603002: Virtual keyboard - do not change work area of screen if in non-sticky mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Virtual keyboard - do not change work area of screen if in non-sticky mode Created 4 years, 4 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
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/wm/workspace/workspace_layout_manager.h" 5 #include "ash/common/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/ash_switches.h"
9 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/wm/always_on_top_controller.h" 11 #include "ash/common/wm/always_on_top_controller.h"
11 #include "ash/common/wm/fullscreen_window_finder.h" 12 #include "ash/common/wm/fullscreen_window_finder.h"
12 #include "ash/common/wm/window_positioner.h" 13 #include "ash/common/wm/window_positioner.h"
13 #include "ash/common/wm/window_state.h" 14 #include "ash/common/wm/window_state.h"
14 #include "ash/common/wm/wm_event.h" 15 #include "ash/common/wm/wm_event.h"
15 #include "ash/common/wm/wm_screen_util.h" 16 #include "ash/common/wm/wm_screen_util.h"
16 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" 17 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
17 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h" 18 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h"
18 #include "ash/common/wm_root_window_controller.h" 19 #include "ash/common/wm_root_window_controller.h"
19 #include "ash/common/wm_shell.h" 20 #include "ash/common/wm_shell.h"
20 #include "ash/common/wm_window.h" 21 #include "ash/common/wm_window.h"
21 #include "ash/common/wm_window_property.h" 22 #include "ash/common/wm_window_property.h"
23 #include "base/command_line.h"
22 #include "ui/compositor/layer.h" 24 #include "ui/compositor/layer.h"
25 #include "ui/keyboard/keyboard_controller.h"
23 #include "ui/keyboard/keyboard_controller_observer.h" 26 #include "ui/keyboard/keyboard_controller_observer.h"
24 27
25 namespace ash { 28 namespace ash {
26 29
27 WorkspaceLayoutManager::WorkspaceLayoutManager( 30 WorkspaceLayoutManager::WorkspaceLayoutManager(
28 WmWindow* window, 31 WmWindow* window,
29 std::unique_ptr<wm::WorkspaceLayoutManagerDelegate> delegate) 32 std::unique_ptr<wm::WorkspaceLayoutManagerDelegate> delegate)
30 : window_(window), 33 : window_(window),
31 root_window_(window->GetRootWindow()), 34 root_window_(window->GetRootWindow()),
32 root_window_controller_(root_window_->GetRootWindowController()), 35 root_window_controller_(root_window_->GetRootWindowController()),
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); 126 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds);
124 child->GetWindowState()->OnWMEvent(&event); 127 child->GetWindowState()->OnWMEvent(&event);
125 UpdateShelfVisibility(); 128 UpdateShelfVisibility();
126 } 129 }
127 130
128 ////////////////////////////////////////////////////////////////////////////// 131 //////////////////////////////////////////////////////////////////////////////
129 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation: 132 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation:
130 133
131 void WorkspaceLayoutManager::OnKeyboardBoundsChanging( 134 void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
132 const gfx::Rect& new_bounds) { 135 const gfx::Rect& new_bounds) {
136 // If new window behavior flag enabled and in non-sticky mode, do not change
137 // the work area.
138 bool change_work_area =
139 (!base::CommandLine::ForCurrentProcess()->HasSwitch(
140 switches::kAshUseNewVKWindowBehavior) ||
141 keyboard::KeyboardController::GetInstance()->get_lock_keyboard());
142 if (!change_work_area)
143 return;
144
133 WmWindow* window = shell_->GetActiveWindow(); 145 WmWindow* window = shell_->GetActiveWindow();
134 if (!window) 146 if (!window)
135 return; 147 return;
136 148
137 window = window->GetToplevelWindow(); 149 window = window->GetToplevelWindow();
138 if (!window_->Contains(window)) 150 if (!window_->Contains(window))
139 return; 151 return;
140 152
141 wm::WindowState* window_state = window->GetWindowState(); 153 wm::WindowState* window_state = window->GetWindowState();
142 if (window_state->ignore_keyboard_bounds_change()) 154 if (window_state->ignore_keyboard_bounds_change())
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 for (auto* window : windows) { 373 for (auto* window : windows) {
362 wm::WindowState* window_state = window->GetWindowState(); 374 wm::WindowState* window_state = window->GetWindowState();
363 if (window_on_top) 375 if (window_on_top)
364 window_state->DisableAlwaysOnTop(window_on_top); 376 window_state->DisableAlwaysOnTop(window_on_top);
365 else 377 else
366 window_state->RestoreAlwaysOnTop(); 378 window_state->RestoreAlwaysOnTop();
367 } 379 }
368 } 380 }
369 381
370 } // namespace ash 382 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698