OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * Map of all currently open app window. The key is an app id. | 6 * Map of all currently open app window. The key is an app id. |
7 */ | 7 */ |
8 var appWindows = {}; | 8 var appWindows = {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 /** | 93 /** |
94 * Wrapper for a singleton app window. | 94 * Wrapper for a singleton app window. |
95 * | 95 * |
96 * In addition to the AppWindowWrapper requirements the app scripts should | 96 * In addition to the AppWindowWrapper requirements the app scripts should |
97 * have |reload| method that re-initializes the app based on a changed | 97 * have |reload| method that re-initializes the app based on a changed |
98 * |window.appState|. | 98 * |window.appState|. |
99 * | 99 * |
100 * @param {string} url App window content url. | 100 * @param {string} url App window content url. |
101 * @param {object|function} options Options object or a function to return it. | 101 * @param {object|function} options Options object or a function to return it. |
102 * | |
103 * @constructor | 102 * @constructor |
104 */ | 103 */ |
105 function SingletonAppWindowWrapper(url, options) { | 104 function SingletonAppWindowWrapper(url, options) { |
106 AppWindowWrapper.call(this, url, url, options); | 105 AppWindowWrapper.call(this, url, url, options); |
107 } | 106 } |
108 | 107 |
109 /** | 108 /** |
110 * Inherits from AppWindowWrapper. | 109 * Inherits from AppWindowWrapper. |
111 */ | 110 */ |
112 SingletonAppWindowWrapper.prototype = { __proto__: AppWindowWrapper.prototype }; | 111 SingletonAppWindowWrapper.prototype = { __proto__: AppWindowWrapper.prototype }; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 function addExecuteHandler() { | 320 function addExecuteHandler() { |
322 if (!chrome.fileBrowserHandler) { | 321 if (!chrome.fileBrowserHandler) { |
323 console.log('Running outside Chrome OS, loading mock API implementations.'); | 322 console.log('Running outside Chrome OS, loading mock API implementations.'); |
324 util.loadScripts(['js/mock_chrome.js'], addExecuteHandler); | 323 util.loadScripts(['js/mock_chrome.js'], addExecuteHandler); |
325 return; | 324 return; |
326 } | 325 } |
327 chrome.fileBrowserHandler.onExecute.addListener(executeFileBrowserTask); | 326 chrome.fileBrowserHandler.onExecute.addListener(executeFileBrowserTask); |
328 } | 327 } |
329 | 328 |
330 addExecuteHandler(); | 329 addExecuteHandler(); |
OLD | NEW |