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

Side by Side Diff: media/video/capture/video_capture_device.cc

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/video/capture/video_capture_device.h" 5 #include "media/video/capture/video_capture_device.h"
6 6
7 #include "base/i18n/timezone.h" 7 #include "base/i18n/timezone.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 9
10 namespace media { 10 namespace media {
11 11
12 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { 12 const std::string VideoCaptureDevice::Name::GetNameAndModel() const {
13 const std::string model_id = GetModel(); 13 const std::string model_id = GetModel();
14 if (model_id.empty()) 14 if (model_id.empty())
15 return device_name_; 15 return device_name_;
16 const std::string suffix = " (" + model_id + ")"; 16 const std::string suffix = " (" + model_id + ")";
17 if (base::EndsWith(device_name_, suffix, base::CompareCase::SENSITIVE)) 17 if (base::EndsWith(device_name_, suffix, true /* case sensitive */))
18 return device_name_; 18 return device_name_;
19 return device_name_ + suffix; 19 return device_name_ + suffix;
20 } 20 }
21 21
22 VideoCaptureDevice::Name::Name() {} 22 VideoCaptureDevice::Name::Name() {}
23 23
24 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id) 24 VideoCaptureDevice::Name::Name(const std::string& name, const std::string& id)
25 : device_name_(name), unique_id_(id) {} 25 : device_name_(name), unique_id_(id) {}
26 26
27 #if defined(OS_LINUX) 27 #if defined(OS_LINUX)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const char** countries_using_60Hz_end = 146 const char** countries_using_60Hz_end =
147 countries_using_60Hz + arraysize(countries_using_60Hz); 147 countries_using_60Hz + arraysize(countries_using_60Hz);
148 if (std::find(countries_using_60Hz, countries_using_60Hz_end, 148 if (std::find(countries_using_60Hz, countries_using_60Hz_end,
149 current_country) == countries_using_60Hz_end) { 149 current_country) == countries_using_60Hz_end) {
150 return kPowerLine50Hz; 150 return kPowerLine50Hz;
151 } 151 }
152 return kPowerLine60Hz; 152 return kPowerLine60Hz;
153 } 153 }
154 154
155 } // namespace media 155 } // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/mac/video_capture_device_factory_mac.mm ('k') | mojo/runner/shell_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698