Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
| 6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
| 7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' | 7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' |
| 8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; | 8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; |
| 9 | 9 |
| 10 var g_slideshow_data = null; | 10 var g_slideshow_data = null; |
| (...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1839 // when mounts location will be decided. | 1839 // when mounts location will be decided. |
| 1840 if (rescanDirectoryNeeded) | 1840 if (rescanDirectoryNeeded) |
| 1841 self.rescanDirectory_(null, 300); | 1841 self.rescanDirectory_(null, 300); |
| 1842 }); | 1842 }); |
| 1843 }; | 1843 }; |
| 1844 | 1844 |
| 1845 /** | 1845 /** |
| 1846 * Event handler called when some internal task should be executed. | 1846 * Event handler called when some internal task should be executed. |
| 1847 */ | 1847 */ |
| 1848 FileManager.prototype.onFileTaskExecute_ = function(id, details) { | 1848 FileManager.prototype.onFileTaskExecute_ = function(id, details) { |
| 1849 // Each instance of the file manager receives the event. But it must be | |
| 1850 // handled once. Let's it be the first instance in the list returned by | |
|
rginda
2011/08/31 18:10:03
s/Let's/Let/
| |
| 1851 // getViews. | |
| 1852 var windows = chrome.extension.getViews({type: 'tab'}); | |
| 1853 for (var i = 0; i < windows.length; i++) { | |
| 1854 if ('fileManager' in windows[i]) { | |
|
rginda
2011/08/31 18:10:03
This seems hokey. Any window with a variable call
| |
| 1855 if (windows[i]['fileManager'] == this) break; | |
|
rginda
2011/08/31 18:10:03
Newline and indent before break and return, please
| |
| 1856 else return; | |
| 1857 } | |
| 1858 } | |
| 1859 | |
| 1849 var urls = details.entries.map(function(entry) { | 1860 var urls = details.entries.map(function(entry) { |
| 1850 return entry.toURL(); | 1861 return entry.toURL(); |
| 1851 }); | 1862 }); |
| 1852 if (id == 'preview') { | 1863 if (id == 'preview') { |
| 1853 g_slideshow_data = urls; | 1864 g_slideshow_data = urls; |
| 1854 chrome.tabs.create({url: "slideshow.html"}); | 1865 chrome.tabs.create({url: "slideshow.html"}); |
| 1855 } else if (id == 'edit') { | 1866 } else if (id == 'edit') { |
| 1856 this.openImageEditor_(details.entries[0]); | 1867 this.openImageEditor_(details.entries[0]); |
| 1857 } else if (id == 'play' || id == 'enqueue') { | 1868 } else if (id == 'play' || id == 'enqueue') { |
| 1858 chrome.fileBrowserPrivate.viewFiles(urls, id); | 1869 chrome.fileBrowserPrivate.viewFiles(urls, id); |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3266 | 3277 |
| 3267 if (msg) { | 3278 if (msg) { |
| 3268 console.log('no no no'); | 3279 console.log('no no no'); |
| 3269 this.alert.show(msg, onAccept); | 3280 this.alert.show(msg, onAccept); |
| 3270 return false; | 3281 return false; |
| 3271 } | 3282 } |
| 3272 | 3283 |
| 3273 return true; | 3284 return true; |
| 3274 }; | 3285 }; |
| 3275 })(); | 3286 })(); |
| OLD | NEW |