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

Unified Diff: chrome/browser/system_monitor/removable_device_notifications_mac.mm

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typedef, init observer Created 7 years, 11 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/system_monitor/removable_device_notifications_mac.mm
diff --git a/chrome/browser/system_monitor/removable_device_notifications_mac.mm b/chrome/browser/system_monitor/removable_device_notifications_mac.mm
index 89fa5866118df8727cab290fd7dee98a23fa8b82..7e9fca8dd0eecc3b3687523594f00a5785864a23 100644
--- a/chrome/browser/system_monitor/removable_device_notifications_mac.mm
+++ b/chrome/browser/system_monitor/removable_device_notifications_mac.mm
@@ -13,9 +13,6 @@ namespace {
const char kDiskImageModelName[] = "Disk Image";
-static RemovableDeviceNotificationsMac*
- g_removable_device_notifications_mac = NULL;
-
void GetDiskInfoAndUpdateOnFileThread(
const scoped_refptr<RemovableDeviceNotificationsMac>& notifications,
base::mac::ScopedCFTypeRef<CFDictionaryRef> dict,
@@ -51,8 +48,6 @@ void GetDiskInfoAndUpdate(
RemovableDeviceNotificationsMac::RemovableDeviceNotificationsMac() {
session_.reset(DASessionCreate(NULL));
- DCHECK(!g_removable_device_notifications_mac);
- g_removable_device_notifications_mac = this;
DASessionScheduleWithRunLoop(
session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
@@ -78,9 +73,6 @@ RemovableDeviceNotificationsMac::RemovableDeviceNotificationsMac() {
}
RemovableDeviceNotificationsMac::~RemovableDeviceNotificationsMac() {
- DCHECK_EQ(this, g_removable_device_notifications_mac);
- g_removable_device_notifications_mac = NULL;
-
DASessionUnscheduleFromRunLoop(
session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
}
@@ -98,8 +90,7 @@ void RemovableDeviceNotificationsMac::UpdateDisk(
// notification now. This is used for devices that are being removed or
// devices that have changed.
if (ShouldPostNotificationForDisk(it->second)) {
- base::SystemMonitor::Get()->ProcessRemovableStorageDetached(
- it->second.device_id());
+ ProcessDetach(it->second.device_id());
}
}
@@ -113,15 +104,14 @@ void RemovableDeviceNotificationsMac::UpdateDisk(
if (ShouldPostNotificationForDisk(info)) {
string16 display_name = GetDisplayNameForDevice(
info.total_size_in_bytes(), info.device_name());
- base::SystemMonitor::Get()->ProcessRemovableStorageAttached(
- info.device_id(), display_name, info.mount_point().value());
+ ProcessAttach(info.device_id(), display_name, info.mount_point().value());
}
}
}
bool RemovableDeviceNotificationsMac::GetDeviceInfoForPath(
const FilePath& path,
- base::SystemMonitor::RemovableStorageInfo* device_info) const {
+ StorageInfo* device_info) const {
if (!path.IsAbsolute())
return false;
@@ -209,10 +199,4 @@ bool RemovableDeviceNotificationsMac::FindDiskWithMountPoint(
return false;
}
-// static
-RemovableStorageNotifications* RemovableStorageNotifications::GetInstance() {
- DCHECK(g_removable_device_notifications_mac != NULL);
- return g_removable_device_notifications_mac;
-}
-
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698