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

Side by Side Diff: apps/shell_window.cc

Issue 62763003: Leave fullscreen mode in an app window when ESC key is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "apps/shell_window.h" 5 #include "apps/shell_window.h"
6 6
7 #include "apps/shell_window_geometry_cache.h" 7 #include "apps/shell_window_geometry_cache.h"
8 #include "apps/shell_window_registry.h" 8 #include "apps/shell_window_registry.h"
9 #include "apps/ui/native_app_window.h" 9 #include "apps/ui/native_app_window.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 bool* was_blocked) { 279 bool* was_blocked) {
280 DCHECK(Profile::FromBrowserContext(new_contents->GetBrowserContext()) == 280 DCHECK(Profile::FromBrowserContext(new_contents->GetBrowserContext()) ==
281 profile_); 281 profile_);
282 delegate_->AddNewContents(profile_, new_contents, disposition, 282 delegate_->AddNewContents(profile_, new_contents, disposition,
283 initial_pos, user_gesture, was_blocked); 283 initial_pos, user_gesture, was_blocked);
284 } 284 }
285 285
286 void ShellWindow::HandleKeyboardEvent( 286 void ShellWindow::HandleKeyboardEvent(
287 WebContents* source, 287 WebContents* source,
288 const content::NativeWebKeyboardEvent& event) { 288 const content::NativeWebKeyboardEvent& event) {
289 // If the window is currently fullscreen, ESC should leave fullscreen.
290 if (event.windowsKeyCode == ui::VKEY_ESCAPE &&
291 (fullscreen_for_tab_ || fullscreen_for_window_api_)) {
292 Restore();
293 return;
294 }
295
289 native_app_window_->HandleKeyboardEvent(event); 296 native_app_window_->HandleKeyboardEvent(event);
290 } 297 }
291 298
292 void ShellWindow::RequestToLockMouse(WebContents* web_contents, 299 void ShellWindow::RequestToLockMouse(WebContents* web_contents,
293 bool user_gesture, 300 bool user_gesture,
294 bool last_unlocked_by_target) { 301 bool last_unlocked_by_target) {
295 bool has_permission = IsExtensionWithPermissionOrSuggestInConsole( 302 bool has_permission = IsExtensionWithPermissionOrSuggestInConsole(
296 APIPermission::kPointerLock, 303 APIPermission::kPointerLock,
297 extension_, 304 extension_,
298 web_contents->GetRenderViewHost()); 305 web_contents->GetRenderViewHost());
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 region.bounds.x(), 756 region.bounds.x(),
750 region.bounds.y(), 757 region.bounds.y(),
751 region.bounds.right(), 758 region.bounds.right(),
752 region.bounds.bottom(), 759 region.bounds.bottom(),
753 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 760 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
754 } 761 }
755 return sk_region; 762 return sk_region;
756 } 763 }
757 764
758 } // namespace apps 765 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/apps/app_interactive_uitest.cc » ('j') | chrome/browser/apps/app_interactive_uitest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698