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

Side by Side Diff: chrome/browser/chromeos/file_manager/volume_manager.h

Issue 194693002: [fsp] Add requestUnmount() method together with the request manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 9 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_
7 7
8 #include <map>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/files/file.h"
12 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
13 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
14 #include "base/observer_list.h" 16 #include "base/observer_list.h"
15 #include "base/prefs/pref_change_registrar.h" 17 #include "base/prefs/pref_change_registrar.h"
16 #include "chrome/browser/chromeos/drive/drive_integration_service.h" 18 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
17 #include "chrome/browser/chromeos/file_system_provider/observer.h" 19 #include "chrome/browser/chromeos/file_system_provider/observer.h"
18 #include "chrome/browser/chromeos/file_system_provider/service.h" 20 #include "chrome/browser/chromeos/file_system_provider/service.h"
19 #include "chrome/browser/local_discovery/storage/privet_volume_lister.h" 21 #include "chrome/browser/local_discovery/storage/privet_volume_lister.h"
20 #include "chromeos/dbus/cros_disks_client.h" 22 #include "chromeos/dbus/cros_disks_client.h"
21 #include "chromeos/disks/disk_mount_manager.h" 23 #include "chromeos/disks/disk_mount_manager.h"
(...skipping 27 matching lines...) Expand all
49 VOLUME_TYPE_MOUNTED_ARCHIVE_FILE, 51 VOLUME_TYPE_MOUNTED_ARCHIVE_FILE,
50 VOLUME_TYPE_CLOUD_DEVICE, 52 VOLUME_TYPE_CLOUD_DEVICE,
51 VOLUME_TYPE_PROVIDED, 53 VOLUME_TYPE_PROVIDED,
52 VOLUME_TYPE_TESTING 54 VOLUME_TYPE_TESTING
53 }; 55 };
54 56
55 struct VolumeInfo { 57 struct VolumeInfo {
56 VolumeInfo(); 58 VolumeInfo();
57 ~VolumeInfo(); 59 ~VolumeInfo();
58 60
61 // The ID for provided file system. If other type, then undefined.
62 int file_system_id;
63
59 // The ID of the volume. 64 // The ID of the volume.
60 std::string volume_id; 65 std::string volume_id;
61 66
62 // The type of mounted volume. 67 // The type of mounted volume.
63 VolumeType type; 68 VolumeType type;
64 69
65 // The type of device. (e.g. USB, SD card, DVD etc.) 70 // The type of device. (e.g. USB, SD card, DVD etc.)
66 chromeos::DeviceType device_type; 71 chromeos::DeviceType device_type;
67 72
68 // The source path of the volume. 73 // The source path of the volume.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 chromeos::disks::DiskMountManager::MountEvent event, 167 chromeos::disks::DiskMountManager::MountEvent event,
163 chromeos::MountError error_code, 168 chromeos::MountError error_code,
164 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) 169 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info)
165 OVERRIDE; 170 OVERRIDE;
166 virtual void OnFormatEvent( 171 virtual void OnFormatEvent(
167 chromeos::disks::DiskMountManager::FormatEvent event, 172 chromeos::disks::DiskMountManager::FormatEvent event,
168 chromeos::FormatError error_code, 173 chromeos::FormatError error_code,
169 const std::string& device_path) OVERRIDE; 174 const std::string& device_path) OVERRIDE;
170 175
171 // chromeos::file_system_provider::Observer overrides. 176 // chromeos::file_system_provider::Observer overrides.
172 virtual void OnProvidedFileSystemRegistered( 177 virtual void OnProvidedFileSystemMount(
173 const chromeos::file_system_provider::ProvidedFileSystem& file_system) 178 const chromeos::file_system_provider::ProvidedFileSystem& file_system,
174 OVERRIDE; 179 base::File::Error error) OVERRIDE;
175 virtual void OnProvidedFileSystemUnregistered( 180 virtual void OnProvidedFileSystemUnmount(
176 const chromeos::file_system_provider::ProvidedFileSystem& file_system) 181 const chromeos::file_system_provider::ProvidedFileSystem& file_system,
177 OVERRIDE; 182 base::File::Error error) OVERRIDE;
178 183
179 // Called on change to kExternalStorageDisabled pref. 184 // Called on change to kExternalStorageDisabled pref.
180 void OnExternalStorageDisabledChanged(); 185 void OnExternalStorageDisabledChanged();
181 186
182 private: 187 private:
183 void OnPrivetVolumesAvailable( 188 void OnPrivetVolumesAvailable(
184 const local_discovery::PrivetVolumeLister::VolumeList& volumes); 189 const local_discovery::PrivetVolumeLister::VolumeList& volumes);
185 void DoMountEvent(chromeos::MountError error_code, 190 void DoMountEvent(chromeos::MountError error_code,
186 const VolumeInfo& volume_info, 191 const VolumeInfo& volume_info,
187 bool is_remounting); 192 bool is_remounting);
(...skipping 10 matching lines...) Expand all
198 chromeos::file_system_provider::Service* file_system_provider_service_; 203 chromeos::file_system_provider::Service* file_system_provider_service_;
199 204
200 std::map<std::string, VolumeInfo> mounted_volumes_; 205 std::map<std::string, VolumeInfo> mounted_volumes_;
201 206
202 DISALLOW_COPY_AND_ASSIGN(VolumeManager); 207 DISALLOW_COPY_AND_ASSIGN(VolumeManager);
203 }; 208 };
204 209
205 } // namespace file_manager 210 } // namespace file_manager
206 211
207 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ 212 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698