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

Side by Side Diff: chrome/browser/system_monitor/removable_device_notifications_chromeos.cc

Issue 12147002: Add a receiver interface to RemovableStorageNotifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merging Created 7 years, 10 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
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 // chromeos::RemovableDeviceNotificationsCros implementation. 5 // chromeos::RemovableDeviceNotificationsCros implementation.
6 6
7 #include "chrome/browser/system_monitor/removable_device_notifications_chromeos. h" 7 #include "chrome/browser/system_monitor/removable_device_notifications_chromeos. h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 BrowserThread::FILE, FROM_HERE, 149 BrowserThread::FILE, FROM_HERE,
150 base::Bind( 150 base::Bind(
151 &RemovableDeviceNotificationsCros::CheckMountedPathOnFileThread, 151 &RemovableDeviceNotificationsCros::CheckMountedPathOnFileThread,
152 this, mount_info)); 152 this, mount_info));
153 break; 153 break;
154 } 154 }
155 case disks::DiskMountManager::UNMOUNTING: { 155 case disks::DiskMountManager::UNMOUNTING: {
156 MountMap::iterator it = mount_map_.find(mount_info.mount_path); 156 MountMap::iterator it = mount_map_.find(mount_info.mount_path);
157 if (it == mount_map_.end()) 157 if (it == mount_map_.end())
158 return; 158 return;
159 ProcessDetach(it->second.storage_info.device_id); 159 receiver()->ProcessDetach(it->second.storage_info.device_id);
160 mount_map_.erase(it); 160 mount_map_.erase(it);
161 break; 161 break;
162 } 162 }
163 } 163 }
164 } 164 }
165 165
166 void RemovableDeviceNotificationsCros::OnFormatEvent( 166 void RemovableDeviceNotificationsCros::OnFormatEvent(
167 disks::DiskMountManager::FormatEvent event, 167 disks::DiskMountManager::FormatEvent event,
168 FormatError error_code, 168 FormatError error_code,
169 const std::string& device_path) { 169 const std::string& device_path) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM : 239 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM :
240 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_NO_DCIM; 240 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_NO_DCIM;
241 241
242 std::string device_id = chrome::MediaStorageUtil::MakeDeviceId(type, 242 std::string device_id = chrome::MediaStorageUtil::MakeDeviceId(type,
243 unique_id); 243 unique_id);
244 StorageObjectInfo object_info = { 244 StorageObjectInfo object_info = {
245 StorageInfo(device_id, device_label, mount_info.mount_path), 245 StorageInfo(device_id, device_label, mount_info.mount_path),
246 storage_size_in_bytes 246 storage_size_in_bytes
247 }; 247 };
248 mount_map_.insert(std::make_pair(mount_info.mount_path, object_info)); 248 mount_map_.insert(std::make_pair(mount_info.mount_path, object_info));
249 ProcessAttach( 249 receiver()->ProcessAttach(
250 device_id, 250 device_id,
251 chrome::GetDisplayNameForDevice(storage_size_in_bytes, device_label), 251 chrome::GetDisplayNameForDevice(storage_size_in_bytes, device_label),
252 mount_info.mount_path); 252 mount_info.mount_path);
253 } 253 }
254 254
255 } // namespace chromeos 255 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698