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

Side by Side Diff: chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js

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: disable tests on mac Created 7 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 chrome.app.runtime.onLaunched.addListener(function() {
6 chrome.app.window.create('main.html', {}, function(win) {
7 // The following key events handler should have no effect because the
8 // application does not have the 'overrideEscFullscreen' permission.
9 win.contentWindow.document.addEventListener('keydown', function(e) {
10 e.preventDefault();
11 });
12 win.contentWindow.document.addEventListener('keyup', function(e) {
13 e.preventDefault();
14 });
15
16 chrome.test.sendMessage('Launched', function(reply) {
17 switch (reply) {
18 case 'window':
19 win.fullscreen();
20 break;
21 case 'dom':
22 win.contentWindow.document.addEventListener('keydown', function() {
23 win.contentWindow.document.removeEventListener('keydown',
24 arguments.callee);
25 win.contentWindow.document.body.webkitRequestFullscreen();
26 });
27 break;
28 }
29 });
30 });
31 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698