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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 #include "chrome/browser/storage_monitor/media_storage_util.h" 5 #include "chrome/browser/storage_monitor/media_storage_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return std::string(kMacImageCapture) + unique_id; 180 return std::string(kMacImageCapture) + unique_id;
181 } 181 }
182 NOTREACHED(); 182 NOTREACHED();
183 return std::string(); 183 return std::string();
184 } 184 }
185 185
186 // static 186 // static
187 bool MediaStorageUtil::CrackDeviceId(const std::string& device_id, 187 bool MediaStorageUtil::CrackDeviceId(const std::string& device_id,
188 Type* type, std::string* unique_id) { 188 Type* type, std::string* unique_id) {
189 size_t prefix_length = device_id.find_first_of(':'); 189 size_t prefix_length = device_id.find_first_of(':');
190 std::string prefix = prefix_length != std::string::npos ? 190 std::string prefix = prefix_length != std::string::npos
191 device_id.substr(0, prefix_length + 1) : ""; 191 ? device_id.substr(0, prefix_length + 1)
192 : std::string();
192 193
193 Type found_type; 194 Type found_type;
194 if (prefix == kRemovableMassStorageWithDCIMPrefix) { 195 if (prefix == kRemovableMassStorageWithDCIMPrefix) {
195 found_type = REMOVABLE_MASS_STORAGE_WITH_DCIM; 196 found_type = REMOVABLE_MASS_STORAGE_WITH_DCIM;
196 } else if (prefix == kRemovableMassStorageNoDCIMPrefix) { 197 } else if (prefix == kRemovableMassStorageNoDCIMPrefix) {
197 found_type = REMOVABLE_MASS_STORAGE_NO_DCIM; 198 found_type = REMOVABLE_MASS_STORAGE_NO_DCIM;
198 } else if (prefix == kFixedMassStoragePrefix) { 199 } else if (prefix == kFixedMassStoragePrefix) {
199 found_type = FIXED_MASS_STORAGE; 200 found_type = FIXED_MASS_STORAGE;
200 } else if (prefix == kMtpPtpPrefix) { 201 } else if (prefix == kMtpPtpPrefix) {
201 found_type = MTP_OR_PTP; 202 found_type = MTP_OR_PTP;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 static_cast<enum DeviceInfoHistogramBuckets>(event_number); 388 static_cast<enum DeviceInfoHistogramBuckets>(event_number);
388 if (event >= DEVICE_INFO_BUCKET_BOUNDARY) { 389 if (event >= DEVICE_INFO_BUCKET_BOUNDARY) {
389 NOTREACHED(); 390 NOTREACHED();
390 return; 391 return;
391 } 392 }
392 UMA_HISTOGRAM_ENUMERATION("MediaDeviceNotifications.DeviceInfo", event, 393 UMA_HISTOGRAM_ENUMERATION("MediaDeviceNotifications.DeviceInfo", event,
393 DEVICE_INFO_BUCKET_BOUNDARY); 394 DEVICE_INFO_BUCKET_BOUNDARY);
394 } 395 }
395 396
396 } // namespace chrome 397 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/sync/glue/session_model_associator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698