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

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

Issue 2241273004: Move kUseNewVKWindowBehavior switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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"
10 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
12 #include "ash/common/shell_window_ids.h" 11 #include "ash/common/shell_window_ids.h"
13 #include "ash/common/wm/always_on_top_controller.h" 12 #include "ash/common/wm/always_on_top_controller.h"
14 #include "ash/common/wm/fullscreen_window_finder.h" 13 #include "ash/common/wm/fullscreen_window_finder.h"
15 #include "ash/common/wm/window_positioner.h" 14 #include "ash/common/wm/window_positioner.h"
16 #include "ash/common/wm/window_state.h" 15 #include "ash/common/wm/window_state.h"
17 #include "ash/common/wm/wm_event.h" 16 #include "ash/common/wm/wm_event.h"
18 #include "ash/common/wm/wm_screen_util.h" 17 #include "ash/common/wm/wm_screen_util.h"
19 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" 18 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
20 #include "ash/common/wm_root_window_controller.h" 19 #include "ash/common/wm_root_window_controller.h"
21 #include "ash/common/wm_shell.h" 20 #include "ash/common/wm_shell.h"
22 #include "ash/common/wm_window.h" 21 #include "ash/common/wm_window.h"
23 #include "ash/common/wm_window_property.h" 22 #include "ash/common/wm_window_property.h"
24 #include "base/command_line.h" 23 #include "base/command_line.h"
24 #include "ui/base/ui_base_switches.h"
25 #include "ui/compositor/layer.h" 25 #include "ui/compositor/layer.h"
26 #include "ui/keyboard/keyboard_controller.h" 26 #include "ui/keyboard/keyboard_controller.h"
27 #include "ui/keyboard/keyboard_controller_observer.h" 27 #include "ui/keyboard/keyboard_controller_observer.h"
28 28
29 namespace ash { 29 namespace ash {
30 30
31 WorkspaceLayoutManager::WorkspaceLayoutManager(WmWindow* window) 31 WorkspaceLayoutManager::WorkspaceLayoutManager(WmWindow* window)
32 : window_(window), 32 : window_(window),
33 root_window_(window->GetRootWindow()), 33 root_window_(window->GetRootWindow()),
34 root_window_controller_(root_window_->GetRootWindowController()), 34 root_window_controller_(root_window_->GetRootWindowController()),
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 ////////////////////////////////////////////////////////////////////////////// 125 //////////////////////////////////////////////////////////////////////////////
126 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation: 126 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation:
127 127
128 void WorkspaceLayoutManager::OnKeyboardBoundsChanging( 128 void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
129 const gfx::Rect& new_bounds) { 129 const gfx::Rect& new_bounds) {
130 // If new window behavior flag enabled and in non-sticky mode, do not change 130 // If new window behavior flag enabled and in non-sticky mode, do not change
131 // the work area. 131 // the work area.
132 bool change_work_area = 132 bool change_work_area =
133 (!base::CommandLine::ForCurrentProcess()->HasSwitch( 133 (!base::CommandLine::ForCurrentProcess()->HasSwitch(
134 switches::kAshUseNewVKWindowBehavior) || 134 ::switches::kUseNewVKWindowBehavior) ||
sky 2016/08/19 03:05:36 I've commented on this before, but VK is obscure.
hariank 2016/08/19 17:27:20 Done.
135 keyboard::KeyboardController::GetInstance()->get_lock_keyboard()); 135 keyboard::KeyboardController::GetInstance()->get_lock_keyboard());
136 if (!change_work_area) 136 if (!change_work_area)
137 return; 137 return;
138 138
139 WmWindow* window = shell_->GetActiveWindow(); 139 WmWindow* window = shell_->GetActiveWindow();
140 if (!window) 140 if (!window)
141 return; 141 return;
142 142
143 window = window->GetToplevelWindow(); 143 window = window->GetToplevelWindow();
144 if (!window_->Contains(window)) 144 if (!window_->Contains(window))
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 for (auto* window : windows) { 368 for (auto* window : windows) {
369 wm::WindowState* window_state = window->GetWindowState(); 369 wm::WindowState* window_state = window->GetWindowState();
370 if (window_on_top) 370 if (window_on_top)
371 window_state->DisableAlwaysOnTop(window_on_top); 371 window_state->DisableAlwaysOnTop(window_on_top);
372 else 372 else
373 window_state->RestoreAlwaysOnTop(); 373 window_state->RestoreAlwaysOnTop();
374 } 374 }
375 } 375 }
376 376
377 } // namespace ash 377 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698