Chromium Code Reviews| 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 document.addEventListener('DOMContentLoaded', function() { | 5 document.addEventListener('DOMContentLoaded', function() { |
| 6 ActionChoice.load(); | 6 ActionChoice.load(); |
| 7 }); | 7 }); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * The main ActionChoice object. | 10 * The main ActionChoice object. |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 ActionChoice.PREVIEW_COUNT = 3; | 36 ActionChoice.PREVIEW_COUNT = 3; |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * Loads app in the document body. | 39 * Loads app in the document body. |
| 40 * @param {FileSystem=} opt_filesystem Local file system. | 40 * @param {FileSystem=} opt_filesystem Local file system. |
| 41 * @param {Object} opt_params Parameters. | 41 * @param {Object} opt_params Parameters. |
| 42 */ | 42 */ |
| 43 ActionChoice.load = function(opt_filesystem, opt_params) { | 43 ActionChoice.load = function(opt_filesystem, opt_params) { |
| 44 ImageUtil.metrics = metrics; | 44 ImageUtil.metrics = metrics; |
| 45 | 45 |
| 46 var hash = location.hash ? location.hash.substr(1) : ''; | 46 var hash = location.hash ? decodeURI(location.hash.substr(1)) : ''; |
| 47 var params = opt_params || {}; | 47 var params = opt_params || {}; |
| 48 if (!params.source) params.source = hash; | 48 if (!params.source) params.source = hash; |
| 49 if (!params.metadataCache) params.metadataCache = MetadataCache.createFull(); | 49 if (!params.metadataCache) params.metadataCache = MetadataCache.createFull(); |
| 50 | 50 |
| 51 function onFilesystem(filesystem) { | 51 function onFilesystem(filesystem) { |
| 52 var dom = document.querySelector('.action-choice'); | 52 var dom = document.querySelector('.action-choice'); |
| 53 new ActionChoice(dom, filesystem, params); | 53 ActionChoice.instance = new ActionChoice(dom, filesystem, params); |
|
Vladislav Kaznacheev
2012/12/17 09:21:49
Why in this patch?
dgozman
2012/12/17 10:08:28
Well, creating a separate patch seems like an over
| |
| 54 } | 54 } |
| 55 | 55 |
| 56 chrome.fileBrowserPrivate.getStrings(function(strings) { | 56 chrome.fileBrowserPrivate.getStrings(function(strings) { |
| 57 loadTimeData.data = strings; | 57 loadTimeData.data = strings; |
| 58 | 58 |
| 59 i18nTemplate.process(document, loadTimeData); | 59 i18nTemplate.process(document, loadTimeData); |
| 60 | 60 |
| 61 if (opt_filesystem) { | 61 if (opt_filesystem) { |
| 62 onFilesystem(opt_filesystem); | 62 onFilesystem(opt_filesystem); |
| 63 } else { | 63 } else { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 var path = this.sourceEntry_.fullPath; | 285 var path = this.sourceEntry_.fullPath; |
| 286 if (util.platform.v2()) { | 286 if (util.platform.v2()) { |
| 287 chrome.runtime.getBackgroundPage(function(bg) { | 287 chrome.runtime.getBackgroundPage(function(bg) { |
| 288 bg.launchFileManager({defaultPath: path}); | 288 bg.launchFileManager({defaultPath: path}); |
| 289 }); | 289 }); |
| 290 } else { | 290 } else { |
| 291 var url = util.platform.getURL('main.html') + '#' + path; | 291 var url = util.platform.getURL('main.html') + '#' + path; |
| 292 util.platform.createWindow(url); | 292 util.platform.createWindow(url); |
| 293 } | 293 } |
| 294 }; | 294 }; |
| OLD | NEW |