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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_mac.mm

Issue 12544005: Consolidate storage_monitor/MediaDeviceNotificationsUtils into MediaStorageUtil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another chromeos fix Created 7 years, 9 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 #include "chrome/browser/storage_monitor/storage_monitor_mac.h" 5 #include "chrome/browser/storage_monitor/storage_monitor_mac.h"
6 6
7 #include "chrome/browser/storage_monitor/media_device_notifications_utils.h" 7 #include "chrome/browser/storage_monitor/media_storage_util.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 9
10 namespace chrome { 10 namespace chrome {
11 11
12 namespace { 12 namespace {
13 13
14 const char kDiskImageModelName[] = "Disk Image"; 14 const char kDiskImageModelName[] = "Disk Image";
15 15
16 void GetDiskInfoAndUpdateOnFileThread( 16 void GetDiskInfoAndUpdateOnFileThread(
17 const scoped_refptr<StorageMonitorMac>& monitor, 17 const scoped_refptr<StorageMonitorMac>& monitor,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 if (update_type == UPDATE_DEVICE_REMOVED) { 95 if (update_type == UPDATE_DEVICE_REMOVED) {
96 if (it != disk_info_map_.end()) 96 if (it != disk_info_map_.end())
97 disk_info_map_.erase(it); 97 disk_info_map_.erase(it);
98 } else { 98 } else {
99 disk_info_map_[info.bsd_name()] = info; 99 disk_info_map_[info.bsd_name()] = info;
100 MediaStorageUtil::RecordDeviceInfoHistogram(true, info.device_id(), 100 MediaStorageUtil::RecordDeviceInfoHistogram(true, info.device_id(),
101 info.device_name()); 101 info.device_name());
102 if (ShouldPostNotificationForDisk(info)) { 102 if (ShouldPostNotificationForDisk(info)) {
103 string16 display_name = GetDisplayNameForDevice( 103 string16 display_name = MediaStorageUtil::GetDisplayNameForDevice(
104 info.total_size_in_bytes(), info.device_name()); 104 info.total_size_in_bytes(), info.device_name());
105 receiver()->ProcessAttach(StorageInfo( 105 receiver()->ProcessAttach(StorageInfo(
106 info.device_id(), display_name, info.mount_point().value())); 106 info.device_id(), display_name, info.mount_point().value()));
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 bool StorageMonitorMac::GetStorageInfoForPath(const base::FilePath& path, 111 bool StorageMonitorMac::GetStorageInfoForPath(const base::FilePath& path,
112 StorageInfo* device_info) const { 112 StorageInfo* device_info) const {
113 if (!path.IsAbsolute()) 113 if (!path.IsAbsolute())
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) { 176 it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) {
177 if (it->second.mount_point() == mount_point) { 177 if (it->second.mount_point() == mount_point) {
178 *info = it->second; 178 *info = it->second;
179 return true; 179 return true;
180 } 180 }
181 } 181 }
182 return false; 182 return false;
183 } 183 }
184 184
185 } // namespace chrome 185 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698