| OLD | NEW |
| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @param {Object.<string, string>} stringData String data. | 8 * @param {Object.<string, string>} stringData String data. |
| 9 * @param {VolumeManager} volumeManager Volume manager. | 9 * @param {VolumeManager} volumeManager Volume manager. |
| 10 */ | 10 */ |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 * Promise to be fulfilled with entries that are used for reopening the | 106 * Promise to be fulfilled with entries that are used for reopening the |
| 107 * application window. | 107 * application window. |
| 108 * @type {Promise} | 108 * @type {Promise} |
| 109 */ | 109 */ |
| 110 var reopenEntriesPromsie = null; | 110 var reopenEntriesPromsie = null; |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * Launches the application with entries. | 113 * Launches the application with entries. |
| 114 * | 114 * |
| 115 * @param {Promise} selectedEntriesPromise Promise to be fulfilled with the | 115 * @param {Promise} selectedEntriesPromise Promise to be fulfilled with the |
| 116 * entries that are stored in the exteranl file system (not in the isolated | 116 * entries that are stored in the external file system (not in the isolated |
| 117 * file system). | 117 * file system). |
| 118 * @return {Promise} Promise to be fulfilled after the applicaiton is launched. | 118 * @return {Promise} Promise to be fulfilled after the application is launched. |
| 119 */ | 119 */ |
| 120 function launch(selectedEntriesPromise) { | 120 function launch(selectedEntriesPromise) { |
| 121 // If there is the previous window, close the window. | 121 // If there is the previous window, close the window. |
| 122 if (appWindowPromise) { | 122 if (appWindowPromise) { |
| 123 reopenEntriesPromsie = selectedEntriesPromise; | 123 reopenEntriesPromsie = selectedEntriesPromise; |
| 124 appWindowPromise.then(function(appWindow) { | 124 appWindowPromise.then(function(appWindow) { |
| 125 appWindow.close(); | 125 appWindow.close(); |
| 126 }); | 126 }); |
| 127 return Promise.reject('The window has already opened.'); | 127 return Promise.reject('The window has already opened.'); |
| 128 } | 128 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 chrome.runtime.onMessageExternal.addListener(function(message) { | 206 chrome.runtime.onMessageExternal.addListener(function(message) { |
| 207 if (message.name !== 'testResourceLoaded') | 207 if (message.name !== 'testResourceLoaded') |
| 208 return; | 208 return; |
| 209 var script = document.createElement('script'); | 209 var script = document.createElement('script'); |
| 210 script.src = | 210 script.src = |
| 211 'chrome-extension://ejhcmmdhhpdhhgmifplfmjobgegbibkn' + | 211 'chrome-extension://ejhcmmdhhpdhhgmifplfmjobgegbibkn' + |
| 212 '/gallery/test_loader.js'; | 212 '/gallery/test_loader.js'; |
| 213 document.documentElement.appendChild(script); | 213 document.documentElement.appendChild(script); |
| 214 }); | 214 }); |
| 215 } | 215 } |
| OLD | NEW |