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

Unified Diff: ui/file_manager/file_manager/background/js/entry_location_impl.js

Issue 2292873003: Divide volume_manager.js into files for each classes and extract interfaces from them. (Closed)
Patch Set: Address comments. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/background/js/entry_location_impl.js
diff --git a/ui/file_manager/file_manager/background/js/entry_location_impl.js b/ui/file_manager/file_manager/background/js/entry_location_impl.js
new file mode 100644
index 0000000000000000000000000000000000000000..34713d9ff6265000e6bebb34e51d5b37e80cb2af
--- /dev/null
+++ b/ui/file_manager/file_manager/background/js/entry_location_impl.js
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * Location information which shows where the path points in FileManager's
+ * file system.
+ *
+ * @param {!VolumeInfo} volumeInfo Volume information.
+ * @param {VolumeManagerCommon.RootType} rootType Root type.
+ * @param {boolean} isRootEntry Whether the entry is root entry or not.
+ * @param {boolean} isReadOnly Whether the entry is read only or not.
+ * @constructor
+ * @implements {EntryLocation}
+ */
+function EntryLocationImpl(volumeInfo, rootType, isRootEntry, isReadOnly) {
+ /** @override */
+ this.volumeInfo = volumeInfo;
+
+ /** @override */
+ this.rootType = rootType;
+
+ /** @override */
+ this.isRootEntry = isRootEntry;
+
+ /** @override */
+ this.isSpecialSearchRoot =
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_OFFLINE ||
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_SHARED_WITH_ME ||
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_RECENT;
+
+ /** @override */
+ this.isDriveBased =
+ this.rootType === VolumeManagerCommon.RootType.DRIVE ||
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_OTHER ||
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_SHARED_WITH_ME ||
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_RECENT ||
+ this.rootType === VolumeManagerCommon.RootType.DRIVE_OFFLINE;
+
+ /** @override */
+ this.isReadOnly = isReadOnly;
+
+ Object.freeze(this);
+}

Powered by Google App Engine
This is Rietveld 408576698