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

Unified Diff: chrome/browser/chromeos/file_manager/volume_manager.h

Issue 1137383002: Show the eject button only for removabled and file handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_manager/volume_manager.h
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.h b/chrome/browser/chromeos/file_manager/volume_manager.h
index efaf20f2857767687367378c6ce057a10309c04c..2e19149ced14c8cada5c2e704925c5b58cfbaaab 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.h
+++ b/chrome/browser/chromeos/file_manager/volume_manager.h
@@ -66,6 +66,9 @@ enum MountContext {
MOUNT_CONTEXT_UNKNOWN
};
+// Source of a volume's data.
+enum Source { SOURCE_FILE, SOURCE_DEVICE, SOURCE_NETWORK, SOURCE_SYSTEM };
+
// Represents a volume (mount point) in the volume manager. Validity of the data
// is guaranteed by the weak pointer. Simply saying, the weak pointer should be
// valid as long as the volume is mounted.
@@ -97,6 +100,7 @@ class Volume : public base::SupportsWeakPtr<Volume> {
const std::string& volume_id() const { return volume_id_; }
const std::string& file_system_id() const { return file_system_id_; }
const std::string& extension_id() const { return extension_id_; }
+ Source source() const { return source_; }
VolumeType type() const { return type_; }
chromeos::DeviceType device_type() const { return device_type_; }
const base::FilePath& source_path() const { return source_path_; }
@@ -112,6 +116,7 @@ class Volume : public base::SupportsWeakPtr<Volume> {
bool is_parent() const { return is_parent_; }
bool is_read_only() const { return is_read_only_; }
bool has_media() const { return has_media_; }
+ bool configurable() const { return configurable_; }
private:
Volume();
@@ -127,6 +132,9 @@ class Volume : public base::SupportsWeakPtr<Volume> {
// to an empty string.
std::string extension_id_;
+ // The source of the volume's data.
+ Source source_;
+
// The type of mounted volume.
VolumeType type_;
@@ -170,6 +178,9 @@ class Volume : public base::SupportsWeakPtr<Volume> {
// True if the volume contains media.
bool has_media_;
+ // True if the volume is configurable.
+ bool configurable_;
+
DISALLOW_COPY_AND_ASSIGN(Volume);
};
@@ -228,6 +239,9 @@ class VolumeManager : public KeyedService,
chromeos::DeviceType device_type,
bool read_only);
+ // For testing purpose, adds the volume info to the volume manager.
+ void AddVolumeForTesting(const linked_ptr<Volume>& volume);
+
// drive::DriveIntegrationServiceObserver overrides.
void OnFileSystemMounted() override;
void OnFileSystemBeingUnmounted() override;
@@ -271,9 +285,10 @@ class VolumeManager : public KeyedService,
private:
void OnDiskMountManagerRefreshed(bool success);
void OnStorageMonitorInitialized();
- void DoMountEvent(chromeos::MountError error_code, linked_ptr<Volume> volume);
+ void DoMountEvent(chromeos::MountError error_code,
+ const linked_ptr<Volume>& volume);
void DoUnmountEvent(chromeos::MountError error_code,
- linked_ptr<Volume> volume);
+ const linked_ptr<Volume>& volume);
Profile* profile_;
drive::DriveIntegrationService* drive_integration_service_; // Not owned.

Powered by Google App Engine
This is Rietveld 408576698