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

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

Issue 109973002: Migrate from URLs to Entries in the Files App's gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/photo/slide_mode.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 * Thin wrapper for VolumeManager. This should be an interface proxy to talk 6 * Thin wrapper for VolumeManager. This should be an interface proxy to talk
7 * to VolumeManager. This class also filters Drive related data/events if 7 * to VolumeManager. This class also filters Drive related data/events if
8 * driveEnabled is set to false. 8 * driveEnabled is set to false.
9 * 9 *
10 * @param {VolumeManagerWrapper.DriveEnabledStatus} driveEnabled DRIVE_ENABLED 10 * @param {VolumeManagerWrapper.DriveEnabledStatus} driveEnabled DRIVE_ENABLED
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 * Called on events sent from VolumeManager. This has responsibility to 130 * Called on events sent from VolumeManager. This has responsibility to
131 * re-dispatch the event to the listeners. 131 * re-dispatch the event to the listeners.
132 * @param {Event} event Event object sent from VolumeManager. 132 * @param {Event} event Event object sent from VolumeManager.
133 * @private 133 * @private
134 */ 134 */
135 VolumeManagerWrapper.prototype.onEvent_ = function(event) { 135 VolumeManagerWrapper.prototype.onEvent_ = function(event) {
136 if (!this.driveEnabled_) { 136 if (!this.driveEnabled_) {
137 // If the drive is disabled, ignore all drive related events. 137 // If the drive is disabled, ignore all drive related events.
138 if (event.type === 'drive-connection-changed' || 138 if (event.type === 'drive-connection-changed' ||
139 (event.type === 'externally-unmounted' && 139 (event.type === 'externally-unmounted' &&
140 event.volumeType === util.VolumeType.DRIVE)) 140 event.volumeInfo.volumeType === util.VolumeType.DRIVE))
141 return; 141 return;
142 } 142 }
143 143
144 this.dispatchEvent(event); 144 this.dispatchEvent(event);
145 }; 145 };
146 146
147 /** 147 /**
148 * Called on events of modifying VolumeInfoList. 148 * Called on events of modifying VolumeInfoList.
149 * @param {Event} event Event object sent from VolumeInfoList. 149 * @param {Event} event Event object sent from VolumeInfoList.
150 * @private 150 * @private
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 * @param {VolumeInfo} volumeInfo Volume info. 325 * @param {VolumeInfo} volumeInfo Volume info.
326 * @return {VolumeInfo} Null if the drive is disabled and the given volume is 326 * @return {VolumeInfo} Null if the drive is disabled and the given volume is
327 * drive. Otherwise just returns the volume. 327 * drive. Otherwise just returns the volume.
328 * @private 328 * @private
329 */ 329 */
330 VolumeManagerWrapper.prototype.filterDisabledDriveVolume_ = 330 VolumeManagerWrapper.prototype.filterDisabledDriveVolume_ =
331 function(volumeInfo) { 331 function(volumeInfo) {
332 var isDrive = volumeInfo && volumeInfo.volumeType === util.VolumeType.DRIVE; 332 var isDrive = volumeInfo && volumeInfo.volumeType === util.VolumeType.DRIVE;
333 return this.driveEnabled_ || !isDrive ? volumeInfo : null; 333 return this.driveEnabled_ || !isDrive ? volumeInfo : null;
334 }; 334 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/foreground/js/photo/slide_mode.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698