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

Unified Diff: base/system_monitor/system_monitor.cc

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to head Created 7 years, 12 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: base/system_monitor/system_monitor.cc
diff --git a/base/system_monitor/system_monitor.cc b/base/system_monitor/system_monitor.cc
index 2616275dfbc64db88abaa6abb0fa85e8cf561a7d..2dc33b32a531a81f7bbaa963deaa987f8537e92b 100644
--- a/base/system_monitor/system_monitor.cc
+++ b/base/system_monitor/system_monitor.cc
@@ -22,18 +22,6 @@ static SystemMonitor* g_system_monitor = NULL;
static int kDelayedBatteryCheckMs = 10 * 1000;
#endif // defined(ENABLE_BATTERY_MONITORING)
-SystemMonitor::RemovableStorageInfo::RemovableStorageInfo() {
-}
-
-SystemMonitor::RemovableStorageInfo::RemovableStorageInfo(
- const std::string& id,
- const string16& device_name,
- const FilePath::StringType& device_location)
- : device_id(id),
- name(device_name),
- location(device_location) {
-}
-
SystemMonitor::SystemMonitor()
: power_observer_list_(new ObserverListThreadSafe<PowerObserver>()),
devices_changed_observer_list_(
@@ -99,47 +87,6 @@ void SystemMonitor::ProcessDevicesChanged(DeviceType device_type) {
NotifyDevicesChanged(device_type);
}
-void SystemMonitor::ProcessRemovableStorageAttached(
- const std::string& id,
- const string16& name,
- const FilePath::StringType& location) {
- {
- base::AutoLock lock(removable_storage_lock_);
- if (ContainsKey(removable_storage_map_, id)) {
- // This can happen if our unique id scheme fails. Ignore the incoming
- // non-unique attachment.
- return;
- }
- RemovableStorageInfo info(id, name, location);
- removable_storage_map_.insert(std::make_pair(id, info));
- }
- NotifyRemovableStorageAttached(id, name, location);
-}
-
-void SystemMonitor::ProcessRemovableStorageDetached(const std::string& id) {
- {
- base::AutoLock lock(removable_storage_lock_);
- RemovableStorageMap::iterator it = removable_storage_map_.find(id);
- if (it == removable_storage_map_.end())
- return;
- removable_storage_map_.erase(it);
- }
- NotifyRemovableStorageDetached(id);
-}
-
-std::vector<SystemMonitor::RemovableStorageInfo>
-SystemMonitor::GetAttachedRemovableStorage() const {
- std::vector<RemovableStorageInfo> results;
-
- base::AutoLock lock(removable_storage_lock_);
- for (RemovableStorageMap::const_iterator it = removable_storage_map_.begin();
- it != removable_storage_map_.end();
- ++it) {
- results.push_back(it->second);
- }
- return results;
-}
-
void SystemMonitor::AddPowerObserver(PowerObserver* obs) {
power_observer_list_->AddObserver(obs);
}
@@ -162,22 +109,6 @@ void SystemMonitor::NotifyDevicesChanged(DeviceType device_type) {
&DevicesChangedObserver::OnDevicesChanged, device_type);
}
-void SystemMonitor::NotifyRemovableStorageAttached(
- const std::string& id,
- const string16& name,
- const FilePath::StringType& location) {
- DVLOG(1) << "RemovableStorageAttached with name " << UTF16ToUTF8(name)
- << " and id " << id;
- devices_changed_observer_list_->Notify(
- &DevicesChangedObserver::OnRemovableStorageAttached, id, name, location);
-}
-
-void SystemMonitor::NotifyRemovableStorageDetached(const std::string& id) {
- DVLOG(1) << "RemovableStorageDetached for id " << id;
- devices_changed_observer_list_->Notify(
- &DevicesChangedObserver::OnRemovableStorageDetached, id);
-}
-
void SystemMonitor::NotifyPowerStateChange() {
DVLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off")
<< " battery";

Powered by Google App Engine
This is Rietveld 408576698