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

Unified Diff: chrome/browser/intents/device_attached_intent_source.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: chrome/browser/intents/device_attached_intent_source.cc
diff --git a/chrome/browser/intents/device_attached_intent_source.cc b/chrome/browser/intents/device_attached_intent_source.cc
index 0f0244acfda3afd7f12221032ddf3727728bff7f..e842b88c7c0a84d7748c9d530d01c0522e15927b 100644
--- a/chrome/browser/intents/device_attached_intent_source.cc
+++ b/chrome/browser/intents/device_attached_intent_source.cc
@@ -24,7 +24,6 @@
#include "webkit/glue/web_intent_data.h"
#include "webkit/glue/web_intent_service_data.h"
-using base::SystemMonitor;
using chrome::MediaStorageUtil;
using content::WebContentsDelegate;
using webkit_glue::WebIntentServiceData;
@@ -45,7 +44,7 @@ class DispatchIntentTaskHelper
public:
DispatchIntentTaskHelper(
const base::WeakPtr<DeviceAttachedIntentSource> source,
- SystemMonitor::RemovableStorageInfo device_info)
+ chrome::RemovableStorageNotifications::RemovableStorageInfo device_info)
: source_(source),
device_info_(device_info) {
}
@@ -68,7 +67,8 @@ class DispatchIntentTaskHelper
// Store the device info. This is used while registering the device as file
// system.
- const SystemMonitor::RemovableStorageInfo device_info_;
+ const chrome::RemovableStorageNotifications::RemovableStorageInfo
+ device_info_;
DISALLOW_COPY_AND_ASSIGN(DispatchIntentTaskHelper);
};
@@ -78,15 +78,17 @@ class DispatchIntentTaskHelper
DeviceAttachedIntentSource::DeviceAttachedIntentSource(
Browser* browser, WebContentsDelegate* delegate)
: browser_(browser), delegate_(delegate) {
- SystemMonitor* sys_monitor = SystemMonitor::Get();
- if (sys_monitor)
- sys_monitor->AddDevicesChangedObserver(this);
+ chrome::RemovableStorageNotifications* notifications =
+ chrome::RemovableStorageNotifications::GetInstance();
+ if (notifications)
+ notifications->AddRemovableStorageObserver(this);
}
DeviceAttachedIntentSource::~DeviceAttachedIntentSource() {
- SystemMonitor* sys_monitor = SystemMonitor::Get();
- if (sys_monitor)
- sys_monitor->RemoveDevicesChangedObserver(this);
+ chrome::RemovableStorageNotifications* notifications =
+ chrome::RemovableStorageNotifications::GetInstance();
+ if (notifications)
+ notifications->RemoveRemovableStorageObserver(this);
}
void DeviceAttachedIntentSource::OnRemovableStorageAttached(
@@ -111,7 +113,8 @@ void DeviceAttachedIntentSource::OnRemovableStorageAttached(
if (!device_path.IsAbsolute() || device_path.ReferencesParent())
return;
- SystemMonitor::RemovableStorageInfo device_info(id, name, location);
+ chrome::RemovableStorageNotifications::RemovableStorageInfo device_info(
+ id, name, location);
scoped_refptr<DispatchIntentTaskHelper> task = new DispatchIntentTaskHelper(
AsWeakPtr(), device_info);
WebIntentsRegistryFactory::GetForProfile(browser_->profile())->
@@ -122,7 +125,8 @@ void DeviceAttachedIntentSource::OnRemovableStorageAttached(
}
void DeviceAttachedIntentSource::DispatchIntentsForService(
- const base::SystemMonitor::RemovableStorageInfo& device_info) {
+ const chrome::RemovableStorageNotifications::RemovableStorageInfo&
+ device_info) {
// Store the media device info locally.
device_id_map_.insert(std::make_pair(device_info.device_id, device_info));

Powered by Google App Engine
This is Rietveld 408576698