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

Unified Diff: chrome/browser/intents/device_attached_intent_source.cc

Issue 10873072: Rename SystemMonitor's MediaDevice calls to RemovableStorage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
===================================================================
--- chrome/browser/intents/device_attached_intent_source.cc (revision 153336)
+++ chrome/browser/intents/device_attached_intent_source.cc (working copy)
@@ -4,7 +4,7 @@
#include "chrome/browser/intents/device_attached_intent_source.h"
-#include <string>
+#include <vector>
#include "base/bind.h"
#include "base/file_path.h"
@@ -52,7 +52,7 @@
public:
DispatchIntentTaskHelper(
const base::WeakPtr<DeviceAttachedIntentSource> source,
- SystemMonitor::MediaDeviceInfo device_info)
+ SystemMonitor::RemovableStorageInfo device_info)
: source_(source),
device_info_(device_info) {
}
@@ -75,7 +75,7 @@
// Store the device info. This is used while registering the device as file
// system.
- const SystemMonitor::MediaDeviceInfo device_info_;
+ const SystemMonitor::RemovableStorageInfo device_info_;
DISALLOW_COPY_AND_ASSIGN(DispatchIntentTaskHelper);
};
@@ -96,7 +96,7 @@
sys_monitor->RemoveDevicesChangedObserver(this);
}
-void DeviceAttachedIntentSource::OnMediaDeviceAttached(
+void DeviceAttachedIntentSource::OnRemovableStorageAttached(
const std::string& id,
const string16& name,
const FilePath::StringType& location) {
@@ -120,7 +120,7 @@
if (!device_path.IsAbsolute() || device_path.ReferencesParent())
return;
- SystemMonitor::MediaDeviceInfo device_info(id, name, location);
+ SystemMonitor::RemovableStorageInfo device_info(id, name, location);
scoped_refptr<DispatchIntentTaskHelper> task = new DispatchIntentTaskHelper(
AsWeakPtr(), device_info);
WebIntentsRegistryFactory::GetForProfile(browser_->profile())->
@@ -131,9 +131,9 @@
}
void DeviceAttachedIntentSource::DispatchIntentsForService(
- const base::SystemMonitor::MediaDeviceInfo& device_info) {
+ const base::SystemMonitor::RemovableStorageInfo& device_info) {
// Store the media device info locally.
- device_id_map_.insert(std::make_pair(device_info.unique_id, device_info));
+ device_id_map_.insert(std::make_pair(device_info.device_id, device_info));
std::string device_name(UTF16ToUTF8(device_info.name));
const FilePath device_path(device_info.location);
@@ -151,7 +151,8 @@
content::WebIntentsDispatcher::Create(intent));
}
-void DeviceAttachedIntentSource::OnMediaDeviceDetached(const std::string& id) {
+void DeviceAttachedIntentSource::OnRemovableStorageDetached(
+ const std::string& id) {
DeviceIdToInfoMap::iterator it = device_id_map_.find(id);
if (it == device_id_map_.end())
return;
@@ -164,7 +165,7 @@
#if defined(SUPPORT_MEDIA_FILESYSTEM)
// TODO(kmadhusu, vandebo): Clean up this code. http://crbug.com/140340.
MediaStorageUtil::Type type;
- MediaStorageUtil::CrackDeviceId(it->second.unique_id, &type, NULL);
+ MediaStorageUtil::CrackDeviceId(it->second.device_id, &type, NULL);
if (type == MediaStorageUtil::USB_MTP) {
MediaDeviceMapService::GetInstance()->RemoveMediaDevice(
it->second.location);

Powered by Google App Engine
This is Rietveld 408576698