Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 10231010: gdata: Apply correct mount label when mounting archives in GData (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: gdata: Apply correct mount label when mounting archives in GData Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 * FileManager constructor. 6 * FileManager constructor.
7 * 7 *
8 * FileManager objects encapsulate the functionality of the file selector 8 * FileManager objects encapsulate the functionality of the file selector
9 * dialogs, as well as the full screen file manager application (though the 9 * dialogs, as well as the full screen file manager application (though the
10 * latter is not yet implemented). 10 * latter is not yet implemented).
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 this.unmountedPanel_.setAttribute('loading', true); 687 this.unmountedPanel_.setAttribute('loading', true);
688 } 688 }
689 689
690 // If the user changed to another directory and then back to GData we 690 // If the user changed to another directory and then back to GData we
691 // re-enter this method while the timer is still active. In this case 691 // re-enter this method while the timer is still active. In this case
692 // we only update the UI but do not request the mount again. 692 // we only update the UI but do not request the mount again.
693 if (this.gdataLoadingTimer_) 693 if (this.gdataLoadingTimer_)
694 return; 694 return;
695 695
696 metrics.startInterval('Load.GData'); 696 metrics.startInterval('Load.GData');
697 chrome.fileBrowserPrivate.addMount('', 'gdata', {}); 697 chrome.fileBrowserPrivate.addMount('', 'gdata', {},
698 function(sourcePath) {});
698 699
699 // This timer could fire before the mount succeeds. We will silently 700 // This timer could fire before the mount succeeds. We will silently
700 // replace the error message with the correct directory contents. 701 // replace the error message with the correct directory contents.
701 this.gdataLoadingTimer_ = setTimeout(function() { 702 this.gdataLoadingTimer_ = setTimeout(function() {
702 this.gdataLoadingTimer_ = null; 703 this.gdataLoadingTimer_ = null;
703 this.onGDataUnreachable_('GData load timeout'); 704 this.onGDataUnreachable_('GData load timeout');
704 }.bind(this), 705 }.bind(this),
705 15 * 60 * 1000); 706 15 * 60 * 1000);
706 }; 707 };
707 708
(...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 // This device mount was the reason this File Manager instance was 2624 // This device mount was the reason this File Manager instance was
2624 // created. Now the device is unmounted from another instance 2625 // created. Now the device is unmounted from another instance
2625 // or the user removed the device manually. Close this instance. 2626 // or the user removed the device manually. Close this instance.
2626 // window.close() sometimes doesn't work. 2627 // window.close() sometimes doesn't work.
2627 chrome.tabs.getCurrent(function(tab) { 2628 chrome.tabs.getCurrent(function(tab) {
2628 chrome.tabs.remove(tab.id); 2629 chrome.tabs.remove(tab.id);
2629 }); 2630 });
2630 return; 2631 return;
2631 } 2632 }
2632 // Current directory just unmounted. Move to the 'Downloads'. 2633 // Current directory just unmounted. Move to the 'Downloads'.
2633 changeDirectoryTo = this.directoryModel_.getDefaultDirectory(); 2634 changeDirectoryTo = self.directoryModel_.getDefaultDirectory();
2634 } 2635 }
2635 } 2636 }
2636 2637
2637 // Even if something failed root list should be rescanned. 2638 // Even if something failed root list should be rescanned.
2638 // Failed mounts can "give" us new devices which might be formatted, 2639 // Failed mounts can "give" us new devices which might be formatted,
2639 // so we have to refresh root list then. 2640 // so we have to refresh root list then.
2640 self.directoryModel_.updateRoots(function() { 2641 self.directoryModel_.updateRoots(function() {
2641 if (changeDirectoryTo) { 2642 if (changeDirectoryTo) {
2642 self.directoryModel_.changeDirectory(changeDirectoryTo); 2643 self.directoryModel_.changeDirectory(changeDirectoryTo);
2643 } 2644 }
(...skipping 15 matching lines...) Expand all
2659 position = urls.indexOf(selectedUrl); 2660 position = urls.indexOf(selectedUrl);
2660 } 2661 }
2661 chrome.mediaPlayerPrivate.play(urls, position); 2662 chrome.mediaPlayerPrivate.play(urls, position);
2662 } else if (id == 'mount-archive') { 2663 } else if (id == 'mount-archive') {
2663 var self = this; 2664 var self = this;
2664 this.resolveSelectResults_(urls, function(urls) { 2665 this.resolveSelectResults_(urls, function(urls) {
2665 for (var index = 0; index < urls.length; ++index) { 2666 for (var index = 0; index < urls.length; ++index) {
2666 // Url in MountCompleted event won't be escaped, so let's make sure 2667 // Url in MountCompleted event won't be escaped, so let's make sure
2667 // we don't use escaped one in mountRequests_. 2668 // we don't use escaped one in mountRequests_.
2668 var unescapedUrl = unescape(urls[index]); 2669 var unescapedUrl = unescape(urls[index]);
2669 self.mountRequests_.push(unescapedUrl); 2670 var callback = function(sourcePath) {
2670 chrome.fileBrowserPrivate.addMount(unescapedUrl, 'file', {}); 2671 self.mountRequests_.push(self.isOnGData() ? sourcePath :
2672 unescapedUrl);
2673 }
2674 chrome.fileBrowserPrivate.addMount(unescapedUrl, 'file', {},
tbarzic 2012/04/27 05:44:21 How about: chrome.fileBrowserPrivate.addMount(unes
hshi 2012/04/27 18:48:56 Done.
2675 callback);
2671 } 2676 }
2672 }); 2677 });
2673 } else if (id == 'format-device') { 2678 } else if (id == 'format-device') {
2674 this.confirm.show(str('FORMATTING_WARNING'), function() { 2679 this.confirm.show(str('FORMATTING_WARNING'), function() {
2675 chrome.fileBrowserPrivate.formatDevice(urls[0]); 2680 chrome.fileBrowserPrivate.formatDevice(urls[0]);
2676 }); 2681 });
2677 } else if (id == 'gallery') { 2682 } else if (id == 'gallery') {
2678 this.openGallery_(urls); 2683 this.openGallery_(urls);
2679 } else if (id == 'view-pdf' || id == 'view-in-browser' || 2684 } else if (id == 'view-pdf' || id == 'view-in-browser' ||
2680 id == 'install-crx' || id == 'open-hosted') { 2685 id == 'install-crx' || id == 'open-hosted') {
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
4371 4376
4372 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner); 4377 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner);
4373 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner); 4378 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner);
4374 4379
4375 var style = this.document_.createElement('link'); 4380 var style = this.document_.createElement('link');
4376 style.rel = 'stylesheet'; 4381 style.rel = 'stylesheet';
4377 style.href = 'css/gdrive_welcome.css'; 4382 style.href = 'css/gdrive_welcome.css';
4378 this.document_.head.appendChild(style); 4383 this.document_.head.appendChild(style);
4379 }; 4384 };
4380 })(); 4385 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698