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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_window_manager.cc

Issue 2040493003: ChromeOS: disable ToggleMaximize for login and lock screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/maximize_mode/maximize_mode_window_manager.h" 5 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 11 #include "ash/shell_window_ids.h"
11 #include "ash/wm/common/window_state.h" 12 #include "ash/wm/common/window_state.h"
12 #include "ash/wm/common/wm_event.h" 13 #include "ash/wm/common/wm_event.h"
13 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" 14 #include "ash/wm/maximize_mode/maximize_mode_window_state.h"
14 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" 15 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h"
15 #include "ash/wm/mru_window_tracker.h" 16 #include "ash/wm/mru_window_tracker.h"
16 #include "ash/wm/overview/window_selector_controller.h" 17 #include "ash/wm/overview/window_selector_controller.h"
17 #include "ash/wm/window_state_aura.h" 18 #include "ash/wm/window_state_aura.h"
18 #include "ash/wm/window_util.h" 19 #include "ash/wm/window_util.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const display::Display& display) { 158 const display::Display& display) {
158 DisplayConfigurationChanged(); 159 DisplayConfigurationChanged();
159 } 160 }
160 161
161 void MaximizeModeWindowManager::OnDisplayMetricsChanged(const display::Display&, 162 void MaximizeModeWindowManager::OnDisplayMetricsChanged(const display::Display&,
162 uint32_t) { 163 uint32_t) {
163 // Nothing to do here. 164 // Nothing to do here.
164 } 165 }
165 166
166 void MaximizeModeWindowManager::OnTouchEvent(ui::TouchEvent* event) { 167 void MaximizeModeWindowManager::OnTouchEvent(ui::TouchEvent* event) {
168 const SessionStateDelegate* delegate =
169 Shell::GetInstance()->session_state_delegate();
170
171 if (delegate->IsScreenLocked())
172 return;
173
174 switch (delegate->GetSessionState()) {
175 case SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY:
176 return;
177 case SessionStateDelegate::SESSION_STATE_ACTIVE:
178 break;
179 case SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY:
180 return;
181 }
182
167 if (event->type() != ui::ET_TOUCH_PRESSED) 183 if (event->type() != ui::ET_TOUCH_PRESSED)
168 return; 184 return;
169 185
170 // Find the active window (from the primary screen) to un-fullscreen. 186 // Find the active window (from the primary screen) to un-fullscreen.
171 aura::Window* window = wm::GetActiveWindow(); 187 aura::Window* window = wm::GetActiveWindow();
172 if (!window) 188 if (!window)
173 return; 189 return;
174 190
175 wm::WindowState* window_state = wm::GetWindowState(window); 191 wm::WindowState* window_state = wm::GetWindowState(window);
176 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen()) 192 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen())
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 RootWindowController* controller = *iter; 343 RootWindowController* controller = *iter;
328 aura::Window* container = Shell::GetContainer( 344 aura::Window* container = Shell::GetContainer(
329 controller->GetRootWindow(), kShellWindowId_DefaultContainer); 345 controller->GetRootWindow(), kShellWindowId_DefaultContainer);
330 controller->workspace_controller()->SetMaximizeBackdropDelegate( 346 controller->workspace_controller()->SetMaximizeBackdropDelegate(
331 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate>( 347 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate>(
332 enable ? new WorkspaceBackdropDelegate(container) : NULL)); 348 enable ? new WorkspaceBackdropDelegate(container) : NULL));
333 } 349 }
334 } 350 }
335 351
336 } // namespace ash 352 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698