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

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

Issue 309793005: Fixing problem with edge swipe exiting immersive mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 6 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 | Annotate | Revision Log
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/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" 10 #include "ash/wm/maximize_mode/maximize_mode_window_state.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void MaximizeModeWindowManager::OnTouchEvent(ui::TouchEvent* event) { 131 void MaximizeModeWindowManager::OnTouchEvent(ui::TouchEvent* event) {
132 if (event->type() != ui::ET_TOUCH_PRESSED) 132 if (event->type() != ui::ET_TOUCH_PRESSED)
133 return; 133 return;
134 134
135 // Find the active window (from the primary screen) to un-fullscreen. 135 // Find the active window (from the primary screen) to un-fullscreen.
136 aura::Window* window = wm::GetActiveWindow(); 136 aura::Window* window = wm::GetActiveWindow();
137 if (!window) 137 if (!window)
138 return; 138 return;
139 139
140 wm::WindowState* window_state = wm::GetWindowState(window); 140 wm::WindowState* window_state = wm::GetWindowState(window);
141 if (!window_state->IsFullscreen()) 141 if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen())
142 return; 142 return;
143 143
144 // Test that the touch happened in the top or bottom lines. 144 // Test that the touch happened in the top or bottom lines.
145 int y = event->y(); 145 int y = event->y();
146 if (y >= kLeaveFullScreenAreaHeightInPixel && 146 if (y >= kLeaveFullScreenAreaHeightInPixel &&
147 y < (window->bounds().height() - kLeaveFullScreenAreaHeightInPixel)) { 147 y < (window->bounds().height() - kLeaveFullScreenAreaHeightInPixel)) {
148 return; 148 return;
149 } 149 }
150 150
151 // Leave full screen mode. 151 // Leave full screen mode.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 RootWindowController* controller = *iter; 267 RootWindowController* controller = *iter;
268 aura::Window* container = Shell::GetContainer( 268 aura::Window* container = Shell::GetContainer(
269 controller->GetRootWindow(), kShellWindowId_DefaultContainer); 269 controller->GetRootWindow(), kShellWindowId_DefaultContainer);
270 controller->workspace_controller()->SetMaximizeBackdropDelegate( 270 controller->workspace_controller()->SetMaximizeBackdropDelegate(
271 scoped_ptr<WorkspaceLayoutManagerDelegate>( 271 scoped_ptr<WorkspaceLayoutManagerDelegate>(
272 enable ? new WorkspaceBackdropDelegate(container) : NULL)); 272 enable ? new WorkspaceBackdropDelegate(container) : NULL));
273 } 273 }
274 } 274 }
275 275
276 } // namespace ash 276 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698