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

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

Issue 306823002: Flip --enable-apps-show-on-first-paint flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests 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 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 chrome.app.runtime.onLaunched.addListener(function() { 5 chrome.app.runtime.onLaunched.addListener(function() {
6 chrome.app.window.create('main.html', {}, function(win) { 6 chrome.app.window.create('main.html', {}, function(win) {
7 // The following key events handler should have no effect because the 7 win.onWindowFirstShown.addListener(function() {
8 // application does not have the 'overrideEscFullscreen' permission. 8 // The following key events handler should have no effect because the
9 win.contentWindow.document.addEventListener('keydown', function(e) { 9 // application does not have the 'overrideEscFullscreen' permission.
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 win.contentWindow.document.addEventListener('keydown', function(e) { 10 win.contentWindow.document.addEventListener('keydown', function(e) {
18 if (e.keyCode != 90) // 'z' 11 e.preventDefault();
19 return; 12 });
20 13 win.contentWindow.document.addEventListener('keyup', function(e) {
21 chrome.test.sendMessage('KeyReceived'); 14 e.preventDefault();
22 }); 15 });
23 16
24 switch (reply) { 17 chrome.test.sendMessage('Launched', function(reply) {
25 case 'window': 18 win.contentWindow.document.addEventListener('keydown', function(e) {
26 win.fullscreen(); 19 if (e.keyCode != 90) // 'z'
27 break; 20 return;
28 case 'dom': 21
29 win.contentWindow.document.addEventListener('keydown', function() { 22 chrome.test.sendMessage('KeyReceived');
30 win.contentWindow.document.removeEventListener('keydown', 23 });
31 arguments.callee); 24
32 win.contentWindow.document.body.webkitRequestFullscreen(); 25 switch (reply) {
33 }); 26 case 'window':
34 break; 27 win.fullscreen();
35 } 28 break;
29 case 'dom':
30 win.contentWindow.document.addEventListener('keydown', function() {
31 win.contentWindow.document.removeEventListener('keydown',
32 arguments.callee);
33 win.contentWindow.document.body.webkitRequestFullscreen();
34 });
35 break;
36 }
37 });
36 }); 38 });
37 }); 39 });
38 }); 40 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698