1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 * Namespace for common types shared between VolumeManager and
9 * VolumeManagerWrapper.
11 var VolumeManagerCommon = {};
14 * Type of a root directory.
18 VolumeManagerCommon.RootType = Object.freeze({
19 // Root for a downloads directory.
20 DOWNLOADS: 'downloads',
22 // Root for a mounted archive volume.
25 // Root for a removable volume.
26 REMOVABLE: 'removable',
28 // Root for a drive volume.
31 // Root for a privet storage volume.
32 CLOUD_DEVICE: 'cloud_device',
34 // Root for a MTP volume.
37 // Root for entries that is not located under RootType.DRIVE. e.g. shared
39 DRIVE_OTHER: 'drive_other',
41 // Fake root for offline available files on the drive.
42 DRIVE_OFFLINE: 'drive_offline',
44 // Fake root for shared files on the drive.
45 DRIVE_SHARED_WITH_ME: 'drive_shared_with_me',
47 // Fake root for recent files on the drive.
48 DRIVE_RECENT: 'drive_recent'
52 * Error type of VolumeManager.
56 VolumeManagerCommon.VolumeError = Object.freeze({
61 UNKNOWN: 'error_unknown',
62 INTERNAL: 'error_internal',
63 INVALID_ARGUMENT: 'error_invalid_argument',
64 INVALID_PATH: 'error_invalid_path',
65 ALREADY_MOUNTED: 'error_path_already_mounted',
66 PATH_NOT_MOUNTED: 'error_path_not_mounted',
67 DIRECTORY_CREATION_FAILED: 'error_directory_creation_failed',
68 INVALID_MOUNT_OPTIONS: 'error_invalid_mount_options',
69 INVALID_UNMOUNT_OPTIONS: 'error_invalid_unmount_options',
70 INSUFFICIENT_PERMISSIONS: 'error_insufficient_permissions',
71 MOUNT_PROGRAM_NOT_FOUND: 'error_mount_program_not_found',
72 MOUNT_PROGRAM_FAILED: 'error_mount_program_failed',
73 INVALID_DEVICE_PATH: 'error_invalid_device_path',
74 UNKNOWN_FILESYSTEM: 'error_unknown_filesystem',
75 UNSUPPORTED_FILESYSTEM: 'error_unsupported_filesystem',
76 INVALID_ARCHIVE: 'error_invalid_archive',
77 AUTHENTICATION: 'error_authentication',
78 PATH_UNMOUNTED: 'error_path_unmounted'
82 * List of connection types of drive.
84 * Keep this in sync with the kDriveConnectionType* constants in
85 * private_api_dirve.cc.
90 VolumeManagerCommon.DriveConnectionType = Object.freeze({
91 OFFLINE: 'offline', // Connection is offline or drive is unavailable.
92 METERED: 'metered', // Connection is metered. Should limit traffic.
93 ONLINE: 'online' // Connection is online.
97 * List of reasons of DriveConnectionType.
99 * Keep this in sync with the kDriveConnectionReason constants in
100 * private_api_drive.cc.
105 VolumeManagerCommon.DriveConnectionReason = Object.freeze({
106 NOT_READY: 'not_ready', // Drive is not ready or authentication is failed.
107 NO_NETWORK: 'no_network', // Network connection is unavailable.
108 NO_SERVICE: 'no_service' // Drive service is unavailable.
112 * The type of each volume.
116 VolumeManagerCommon.VolumeType = Object.freeze({
118 DOWNLOADS: 'downloads',
119 REMOVABLE: 'removable',
121 CLOUD_DEVICE: 'cloud_device',
126 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
127 // Use of this source code is governed by a BSD-style license that can be
128 // found in the LICENSE file.
133 * Namespace for common types shared between VolumeManager and
134 * VolumeManagerWrapper.
136 var VolumeManagerCommon = {};
139 * Type of a root directory.
143 VolumeManagerCommon.RootType = Object.freeze({
144 // Root for a downloads directory.
145 DOWNLOADS: 'downloads',
147 // Root for a mounted archive volume.
150 // Root for a removable volume.
151 REMOVABLE: 'removable',
153 // Root for a drive volume.
156 // Root for a privet storage volume.
157 CLOUD_DEVICE: 'cloud_device',
159 // Root for a MTP volume.
162 // Root for entries that is not located under RootType.DRIVE. e.g. shared
164 DRIVE_OTHER: 'drive_other',
166 // Fake root for offline available files on the drive.
167 DRIVE_OFFLINE: 'drive_offline',
169 // Fake root for shared files on the drive.
170 DRIVE_SHARED_WITH_ME: 'drive_shared_with_me',
172 // Fake root for recent files on the drive.
173 DRIVE_RECENT: 'drive_recent'
177 * Error type of VolumeManager.
181 VolumeManagerCommon.VolumeError = Object.freeze({
182 /* Internal errors */
183 NOT_MOUNTED: 'not_mounted',
187 UNKNOWN: 'error_unknown',
188 INTERNAL: 'error_internal',
189 UNKNOWN_FILESYSTEM: 'error_unknown_filesystem',
190 UNSUPPORTED_FILESYSTEM: 'error_unsupported_filesystem',
191 INVALID_ARCHIVE: 'error_invalid_archive',
192 AUTHENTICATION: 'error_authentication',
193 PATH_UNMOUNTED: 'error_path_unmounted'
197 * List of connection types of drive.
199 * Keep this in sync with the kDriveConnectionType* constants in
200 * private_api_dirve.cc.
205 VolumeManagerCommon.DriveConnectionType = Object.freeze({
206 OFFLINE: 'offline', // Connection is offline or drive is unavailable.
207 METERED: 'metered', // Connection is metered. Should limit traffic.
208 ONLINE: 'online' // Connection is online.
212 * List of reasons of DriveConnectionType.
214 * Keep this in sync with the kDriveConnectionReason constants in
215 * private_api_drive.cc.
220 VolumeManagerCommon.DriveConnectionReason = Object.freeze({
221 NOT_READY: 'not_ready', // Drive is not ready or authentication is failed.
222 NO_NETWORK: 'no_network', // Network connection is unavailable.
223 NO_SERVICE: 'no_service' // Drive service is unavailable.
227 * The type of each volume.
231 VolumeManagerCommon.VolumeType = Object.freeze({
233 DOWNLOADS: 'downloads',
234 REMOVABLE: 'removable',
236 CLOUD_DEVICE: 'cloud_device'