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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_chromeos.cc

Issue 120983002: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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::StorageMonitorCros implementation. 5 // chromeos::StorageMonitorCros implementation.
6 6
7 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" 7 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h"
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 std::string source_path = mount_info.source_path; 51 std::string source_path = mount_info.source_path;
52 52
53 const disks::DiskMountManager::Disk* disk = 53 const disks::DiskMountManager::Disk* disk =
54 disks::DiskMountManager::GetInstance()->FindDiskBySourcePath(source_path); 54 disks::DiskMountManager::GetInstance()->FindDiskBySourcePath(source_path);
55 if (!disk || disk->device_type() == DEVICE_TYPE_UNKNOWN) 55 if (!disk || disk->device_type() == DEVICE_TYPE_UNKNOWN)
56 return false; 56 return false;
57 57
58 std::string unique_id = MakeDeviceUniqueId(*disk); 58 std::string unique_id = MakeDeviceUniqueId(*disk);
59 // Keep track of device uuid and label, to see how often we receive empty 59 // Keep track of device uuid and label, to see how often we receive empty
60 // values. 60 // values.
61 base::string16 device_label = UTF8ToUTF16(disk->device_label()); 61 base::string16 device_label = base::UTF8ToUTF16(disk->device_label());
62 MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, device_label); 62 MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, device_label);
63 if (unique_id.empty()) 63 if (unique_id.empty())
64 return false; 64 return false;
65 65
66 StorageInfo::Type type = has_dcim ? 66 StorageInfo::Type type = has_dcim ?
67 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM : 67 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM :
68 StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; 68 StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM;
69 69
70 *info = StorageInfo(StorageInfo::MakeDeviceId(type, unique_id), 70 *info = StorageInfo(StorageInfo::MakeDeviceId(type, unique_id),
71 base::string16(), 71 base::string16(),
72 mount_info.mount_path, 72 mount_info.mount_path,
73 device_label, 73 device_label,
74 UTF8ToUTF16(disk->vendor_name()), 74 base::UTF8ToUTF16(disk->vendor_name()),
75 UTF8ToUTF16(disk->product_name()), 75 base::UTF8ToUTF16(disk->product_name()),
76 disk->total_size_in_bytes()); 76 disk->total_size_in_bytes());
77 return true; 77 return true;
78 } 78 }
79 79
80 // Returns whether the mount point in |mount_info| is a media device or not. 80 // Returns whether the mount point in |mount_info| is a media device or not.
81 bool CheckMountedPathOnFileThread( 81 bool CheckMountedPathOnFileThread(
82 const disks::DiskMountManager::MountPointInfo& mount_info) { 82 const disks::DiskMountManager::MountPointInfo& mount_info) {
83 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); 83 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
84 return MediaStorageUtil::HasDcim(base::FilePath(mount_info.mount_path)); 84 return MediaStorageUtil::HasDcim(base::FilePath(mount_info.mount_path));
85 } 85 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 mount_map_.insert(std::make_pair(mount_info.mount_path, info)); 303 mount_map_.insert(std::make_pair(mount_info.mount_path, info));
304 304
305 receiver()->ProcessAttach(info); 305 receiver()->ProcessAttach(info);
306 } 306 }
307 307
308 } // namespace chromeos 308 } // namespace chromeos
309 309
310 StorageMonitor* StorageMonitor::Create() { 310 StorageMonitor* StorageMonitor::Create() {
311 return new chromeos::StorageMonitorCros(); 311 return new chromeos::StorageMonitorCros();
312 } 312 }
OLDNEW
« no previous file with comments | « chrome/browser/storage_monitor/storage_monitor.cc ('k') | chrome/browser/storage_monitor/storage_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698