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 // 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 | 7 |
8 /** | 8 /** |
9 * FileManager constructor. | 9 * FileManager constructor. |
10 * | 10 * |
(...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2944 var position = 0; | 2944 var position = 0; |
2945 if (urls.length == 1) { | 2945 if (urls.length == 1) { |
2946 // If just a single audio file is selected pass along every audio file | 2946 // If just a single audio file is selected pass along every audio file |
2947 // in the directory. | 2947 // in the directory. |
2948 var selectedUrl = urls[0]; | 2948 var selectedUrl = urls[0]; |
2949 urls = this.getAllUrlsInCurrentDirectory_().filter(FileType.isAudio); | 2949 urls = this.getAllUrlsInCurrentDirectory_().filter(FileType.isAudio); |
2950 position = urls.indexOf(selectedUrl); | 2950 position = urls.indexOf(selectedUrl); |
2951 } | 2951 } |
2952 chrome.mediaPlayerPrivate.play(urls, position); | 2952 chrome.mediaPlayerPrivate.play(urls, position); |
2953 } else if (id == 'mount-archive') { | 2953 } else if (id == 'mount-archive') { |
2954 for (var index = 0; index < urls.length; ++index) { | 2954 var self = this; |
2955 // Url in MountCompleted event won't be escaped, so let's make sure | 2955 this.resolveSelectResults_(urls, function(urls) { |
Ben Chan
2012/04/17 20:57:53
Have you tested if this change also works with arc
hshi
2012/04/17 21:21:45
Yes this is tested with archives in non-gdata dire
| |
2956 // we don't use escaped one in mountRequests_. | 2956 for (var index = 0; index < urls.length; ++index) { |
2957 var unescapedUrl = unescape(urls[index]); | 2957 // Url in MountCompleted event won't be escaped, so let's make sure |
2958 this.mountRequests_.push(unescapedUrl); | 2958 // we don't use escaped one in mountRequests_. |
2959 chrome.fileBrowserPrivate.addMount(unescapedUrl, 'file', {}); | 2959 var unescapedUrl = unescape(urls[index]); |
2960 } | 2960 self.mountRequests_.push(unescapedUrl); |
2961 chrome.fileBrowserPrivate.addMount(unescapedUrl, 'file', {}); | |
2962 } | |
2963 }); | |
2961 } else if (id == 'format-device') { | 2964 } else if (id == 'format-device') { |
2962 this.confirm.show(str('FORMATTING_WARNING'), function() { | 2965 this.confirm.show(str('FORMATTING_WARNING'), function() { |
2963 chrome.fileBrowserPrivate.formatDevice(urls[0]); | 2966 chrome.fileBrowserPrivate.formatDevice(urls[0]); |
2964 }); | 2967 }); |
2965 } else if (id == 'gallery') { | 2968 } else if (id == 'gallery') { |
2966 this.openGallery_(urls); | 2969 this.openGallery_(urls); |
2967 } else if (id == 'view-pdf' || id == 'view-in-browser' || | 2970 } else if (id == 'view-pdf' || id == 'view-in-browser' || |
2968 id == 'install-crx' || id == 'open-hosted') { | 2971 id == 'install-crx' || id == 'open-hosted') { |
2969 chrome.fileBrowserPrivate.viewFiles(urls, 'default', function(success) { | 2972 chrome.fileBrowserPrivate.viewFiles(urls, 'default', function(success) { |
2970 if (!success) | 2973 if (!success) |
(...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4726 | 4729 |
4727 chrome.fileBrowserPrivate.setGDataPreferences(changeInfo); | 4730 chrome.fileBrowserPrivate.setGDataPreferences(changeInfo); |
4728 | 4731 |
4729 if (oldValue) { | 4732 if (oldValue) { |
4730 event.target.removeAttribute('checked'); | 4733 event.target.removeAttribute('checked'); |
4731 } else { | 4734 } else { |
4732 event.target.setAttribute('checked', 'checked'); | 4735 event.target.setAttribute('checked', 'checked'); |
4733 } | 4736 } |
4734 }; | 4737 }; |
4735 })(); | 4738 })(); |
OLD | NEW |