| OLD | NEW |
| 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/maximize_mode/maximize_mode_window_state.h" | 12 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" |
| 12 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" | 13 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" |
| 13 #include "ash/wm/mru_window_tracker.h" | 14 #include "ash/wm/mru_window_tracker.h" |
| 14 #include "ash/wm/overview/window_selector_controller.h" | 15 #include "ash/wm/overview/window_selector_controller.h" |
| 15 #include "ash/wm/window_state.h" | 16 #include "ash/wm/window_state.h" |
| 16 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
| 17 #include "ash/wm/wm_event.h" | 18 #include "ash/wm/wm_event.h" |
| 18 #include "ash/wm/workspace_controller.h" | 19 #include "ash/wm/workspace_controller.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void MaximizeModeWindowManager::OnDisplayRemoved(const gfx::Display& display) { | 155 void MaximizeModeWindowManager::OnDisplayRemoved(const gfx::Display& display) { |
| 155 DisplayConfigurationChanged(); | 156 DisplayConfigurationChanged(); |
| 156 } | 157 } |
| 157 | 158 |
| 158 void MaximizeModeWindowManager::OnDisplayMetricsChanged(const gfx::Display&, | 159 void MaximizeModeWindowManager::OnDisplayMetricsChanged(const gfx::Display&, |
| 159 uint32_t) { | 160 uint32_t) { |
| 160 // Nothing to do here. | 161 // Nothing to do here. |
| 161 } | 162 } |
| 162 | 163 |
| 163 void MaximizeModeWindowManager::OnTouchEvent(ui::TouchEvent* event) { | 164 void MaximizeModeWindowManager::OnTouchEvent(ui::TouchEvent* event) { |
| 165 const SessionStateDelegate* delegate = |
| 166 Shell::GetInstance()->session_state_delegate(); |
| 167 |
| 168 if (delegate->IsScreenLocked()) |
| 169 return; |
| 170 |
| 171 switch (delegate->GetSessionState()) { |
| 172 case SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY: |
| 173 return; |
| 174 case SessionStateDelegate::SESSION_STATE_ACTIVE: |
| 175 break; |
| 176 case SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY: |
| 177 return; |
| 178 } |
| 179 |
| 164 if (event->type() != ui::ET_TOUCH_PRESSED) | 180 if (event->type() != ui::ET_TOUCH_PRESSED) |
| 165 return; | 181 return; |
| 166 | 182 |
| 167 // Find the active window (from the primary screen) to un-fullscreen. | 183 // Find the active window (from the primary screen) to un-fullscreen. |
| 168 aura::Window* window = wm::GetActiveWindow(); | 184 aura::Window* window = wm::GetActiveWindow(); |
| 169 if (!window) | 185 if (!window) |
| 170 return; | 186 return; |
| 171 | 187 |
| 172 wm::WindowState* window_state = wm::GetWindowState(window); | 188 wm::WindowState* window_state = wm::GetWindowState(window); |
| 173 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen()) | 189 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen()) |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 RootWindowController* controller = *iter; | 340 RootWindowController* controller = *iter; |
| 325 aura::Window* container = Shell::GetContainer( | 341 aura::Window* container = Shell::GetContainer( |
| 326 controller->GetRootWindow(), kShellWindowId_DefaultContainer); | 342 controller->GetRootWindow(), kShellWindowId_DefaultContainer); |
| 327 controller->workspace_controller()->SetMaximizeBackdropDelegate( | 343 controller->workspace_controller()->SetMaximizeBackdropDelegate( |
| 328 std::unique_ptr<WorkspaceLayoutManagerDelegate>( | 344 std::unique_ptr<WorkspaceLayoutManagerDelegate>( |
| 329 enable ? new WorkspaceBackdropDelegate(container) : NULL)); | 345 enable ? new WorkspaceBackdropDelegate(container) : NULL)); |
| 330 } | 346 } |
| 331 } | 347 } |
| 332 | 348 |
| 333 } // namespace ash | 349 } // namespace ash |
| OLD | NEW |