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

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

Issue 2787363002: Moves couple of WmShell methods to standalone functions (Closed)
Patch Set: feedback and fix applist Created 3 years, 8 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/wm/window_positioning_utils.cc ('k') | ash/common/wm_shell.h » ('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/keyboard/keyboard_observer_register.h" 9 #include "ash/common/keyboard/keyboard_observer_register.h"
10 #include "ash/common/session/session_controller.h" 10 #include "ash/common/session/session_controller.h"
11 #include "ash/common/shelf/wm_shelf.h" 11 #include "ash/common/shelf/wm_shelf.h"
12 #include "ash/common/wm/always_on_top_controller.h" 12 #include "ash/common/wm/always_on_top_controller.h"
13 #include "ash/common/wm/fullscreen_window_finder.h" 13 #include "ash/common/wm/fullscreen_window_finder.h"
14 #include "ash/common/wm/window_positioner.h" 14 #include "ash/common/wm/window_positioner.h"
15 #include "ash/common/wm/window_state.h" 15 #include "ash/common/wm/window_state.h"
16 #include "ash/common/wm/wm_event.h" 16 #include "ash/common/wm/wm_event.h"
17 #include "ash/common/wm/wm_screen_util.h" 17 #include "ash/common/wm/wm_screen_util.h"
18 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" 18 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
19 #include "ash/common/wm_shell.h" 19 #include "ash/common/wm_shell.h"
20 #include "ash/common/wm_window.h" 20 #include "ash/common/wm_window.h"
21 #include "ash/public/cpp/shell_window_ids.h" 21 #include "ash/public/cpp/shell_window_ids.h"
22 #include "ash/root_window_controller.h" 22 #include "ash/root_window_controller.h"
23 #include "ash/shell.h" 23 #include "ash/shell.h"
24 #include "ash/wm/screen_pinning_controller.h" 24 #include "ash/wm/screen_pinning_controller.h"
25 #include "ash/wm/window_properties.h" 25 #include "ash/wm/window_properties.h"
26 #include "ash/wm/window_state_aura.h" 26 #include "ash/wm/window_state_aura.h"
27 #include "ash/wm/window_util.h"
27 #include "base/command_line.h" 28 #include "base/command_line.h"
28 #include "ui/aura/client/aura_constants.h" 29 #include "ui/aura/client/aura_constants.h"
29 #include "ui/base/ui_base_switches.h" 30 #include "ui/base/ui_base_switches.h"
30 #include "ui/compositor/layer.h" 31 #include "ui/compositor/layer.h"
31 #include "ui/display/display.h" 32 #include "ui/display/display.h"
32 #include "ui/display/screen.h" 33 #include "ui/display/screen.h"
33 #include "ui/keyboard/keyboard_controller.h" 34 #include "ui/keyboard/keyboard_controller.h"
34 #include "ui/keyboard/keyboard_controller_observer.h" 35 #include "ui/keyboard/keyboard_controller_observer.h"
35 #include "ui/wm/public/activation_client.h" 36 #include "ui/wm/public/activation_client.h"
36 37
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 const gfx::Rect& new_bounds) { 138 const gfx::Rect& new_bounds) {
138 // If new window behavior flag enabled and in non-sticky mode, do not change 139 // If new window behavior flag enabled and in non-sticky mode, do not change
139 // the work area. 140 // the work area.
140 bool change_work_area = 141 bool change_work_area =
141 (!base::CommandLine::ForCurrentProcess()->HasSwitch( 142 (!base::CommandLine::ForCurrentProcess()->HasSwitch(
142 ::switches::kUseNewVirtualKeyboardBehavior) || 143 ::switches::kUseNewVirtualKeyboardBehavior) ||
143 keyboard::KeyboardController::GetInstance()->keyboard_locked()); 144 keyboard::KeyboardController::GetInstance()->keyboard_locked());
144 if (!change_work_area) 145 if (!change_work_area)
145 return; 146 return;
146 147
147 WmWindow* window = shell_->GetActiveWindow(); 148 WmWindow* window = WmWindow::Get(wm::GetActiveWindow());
148 if (!window) 149 if (!window)
149 return; 150 return;
150 151
151 window = window->GetToplevelWindow(); 152 window = window->GetToplevelWindow();
152 if (!window_->Contains(window)) 153 if (!window_->Contains(window))
153 return; 154 return;
154 155
155 wm::WindowState* window_state = window->GetWindowState(); 156 wm::WindowState* window_state = window->GetWindowState();
156 if (window_state->ignore_keyboard_bounds_change()) 157 if (window_state->ignore_keyboard_bounds_change())
157 return; 158 return;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 for (auto* window : windows) { 397 for (auto* window : windows) {
397 wm::WindowState* window_state = window->GetWindowState(); 398 wm::WindowState* window_state = window->GetWindowState();
398 if (window_on_top) 399 if (window_on_top)
399 window_state->DisableAlwaysOnTop(window_on_top); 400 window_state->DisableAlwaysOnTop(window_on_top);
400 else 401 else
401 window_state->RestoreAlwaysOnTop(); 402 window_state->RestoreAlwaysOnTop();
402 } 403 }
403 } 404 }
404 405
405 } // namespace ash 406 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/window_positioning_utils.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698