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

Side by Side Diff: remoting/webapp/app_remoting/js/ar_background.js

Issue 1438043005: Closure compiler: Add app_remoting_webapp to bot. Fix some errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix parameter notation on createWindow function. Created 5 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
« no previous file with comments | « remoting/webapp/app_remoting/js/app_connected_view.js ('k') | remoting/webapp/files.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** @type {chrome.app.window.AppWindow} */ 5 /** @type {chrome.app.window.AppWindow} */
6 var mainWindow = null; 6 var mainWindow = null;
7 7
8 /** 8 /**
9 * The main window cannot delete its context menu entries on close because it 9 * The main window cannot delete its context menu entries on close because it
10 * is being torn down at that point and doesn't have access to the necessary 10 * is being torn down at that point and doesn't have access to the necessary
11 * APIs. Instead, it notifies the background page of the entries it creates, 11 * APIs. Instead, it notifies the background page of the entries it creates,
12 * and the background pages deletes them when the window is closed. 12 * and the background pages deletes them when the window is closed.
13 * 13 *
14 * @type {!Object} 14 * @type {!Object}
15 */ 15 */
16 var contextMenuIds = {}; 16 var contextMenuIds = {};
17 17
18 /** @param {chrome.app.runtime.LaunchData=} opt_launchData */ 18 /** @param {Object=} opt_launchData */
19 function createWindow(opt_launchData) { 19 function createWindow(opt_launchData) {
20 // If there is already a window, give it focus. 20 // If there is already a window, give it focus.
21 if (mainWindow) { 21 if (mainWindow) {
22 mainWindow.focus(); 22 mainWindow.focus();
23 return; 23 return;
24 } 24 }
25 25
26 var typed_screen = /** @type {{availWidth: number, availHeight: number}} */ 26 var typed_screen = /** @type {{availWidth: number, availHeight: number}} */
27 (screen); 27 (screen);
28 28
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 contextMenuIds[id] = true; 70 contextMenuIds[id] = true;
71 break; 71 break;
72 case 'removeContextMenuId': 72 case 'removeContextMenuId':
73 delete contextMenuIds[id]; 73 delete contextMenuIds[id];
74 break; 74 break;
75 } 75 }
76 }; 76 };
77 77
78 chrome.app.runtime.onLaunched.addListener(createWindow); 78 chrome.app.runtime.onLaunched.addListener(createWindow);
79 window.addEventListener('message', onWindowMessage, false); 79 window.addEventListener('message', onWindowMessage, false);
OLDNEW
« no previous file with comments | « remoting/webapp/app_remoting/js/app_connected_view.js ('k') | remoting/webapp/files.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698