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

Side by Side Diff: chrome/browser/storage_monitor/storage_info.h

Issue 15294020: StorageMonitor: Make StorageInfo a real class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address nits Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_STORAGE_MONITOR_STORAGE_INFO_H_ 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_
6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_ 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 static bool IsMediaDevice(const std::string& device_id); 53 static bool IsMediaDevice(const std::string& device_id);
54 54
55 // Looks inside |device_id| to determine if it is a media device 55 // Looks inside |device_id| to determine if it is a media device
56 // (type isn't FIXED_MASS_STORAGE). 56 // (type isn't FIXED_MASS_STORAGE).
57 static bool IsRemovableDevice(const std::string& device_id); 57 static bool IsRemovableDevice(const std::string& device_id);
58 58
59 // Looks inside |device_id| to determine if it is a mass storage device 59 // Looks inside |device_id| to determine if it is a mass storage device
60 // (type isn't MTP_OR_PTP). 60 // (type isn't MTP_OR_PTP).
61 static bool IsMassStorageDevice(const std::string& device_id); 61 static bool IsMassStorageDevice(const std::string& device_id);
62 62
63 const std::string& device_id() const { return device_id_; }
64 const string16& name() const { return name_; }
65 const base::FilePath::StringType& location() const { return location_; }
66 const string16& storage_label() const { return storage_label_; }
67 const string16& vendor_name() const { return vendor_name_; }
68 const string16& model_name() const { return model_name_; }
69 uint64 total_size_in_bytes() const { return total_size_in_bytes_; }
70
71 void set_device_id(const std::string& device_id) { device_id_ = device_id; }
72 void set_name(const string16& name) { name_ = name; }
73 void set_location(const base::FilePath::StringType& location) {
74 location_ = location;
75 }
76
77 private:
63 // Unique device id - persists between device attachments. 78 // Unique device id - persists between device attachments.
64 // This is the string that should be used as the label for a particular 79 // This is the string that should be used as the label for a particular
65 // storage device when interacting with the API. Clients should treat 80 // storage device when interacting with the API. Clients should treat
66 // this as an opaque string. 81 // this as an opaque string.
67 std::string device_id; 82 std::string device_id_;
68 83
69 // Human readable removable storage device name. 84 // Human readable removable storage device name.
70 string16 name; 85 string16 name_;
71 86
72 // Current attached removable storage device location. 87 // Current attached removable storage device location.
73 base::FilePath::StringType location; 88 base::FilePath::StringType location_;
74 89
75 // Label given to this storage device by the user. 90 // Label given to this storage device by the user.
76 // May be empty if not found or the device is unlabeled. 91 // May be empty if not found or the device is unlabeled.
77 string16 storage_label; 92 string16 storage_label_;
78 93
79 // Vendor name for the removable device. (Human readable) 94 // Vendor name for the removable device. (Human readable)
80 // May be empty if not collected. 95 // May be empty if not collected.
81 string16 vendor_name; 96 string16 vendor_name_;
82 97
83 // Model name for the removable device. (Human readable) 98 // Model name for the removable device. (Human readable)
84 // May be empty if not collected. 99 // May be empty if not collected.
85 string16 model_name; 100 string16 model_name_;
86 101
87 // Size of the removable device in bytes. 102 // Size of the removable device in bytes.
88 // Zero if not collected or unknown. 103 // Zero if not collected or unknown.
89 uint64 total_size_in_bytes; 104 uint64 total_size_in_bytes_;
90 }; 105 };
91 106
92 } // namespace chrome 107 } // namespace chrome
93 108
94 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_ 109 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_INFO_H_
OLDNEW
« no previous file with comments | « chrome/browser/storage_monitor/portable_device_watcher_win.cc ('k') | chrome/browser/storage_monitor/storage_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698