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

Unified Diff: ui/display/chromeos/x11/display_util_x11.cc

Issue 2127373006: Use base::StartWith() in more places when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, resolve conflict Created 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/display/chromeos/x11/display_util_x11.cc
diff --git a/ui/display/chromeos/x11/display_util_x11.cc b/ui/display/chromeos/x11/display_util_x11.cc
index 560edd08e29b4b3fa0f39592f68bf655dea68743..b328655360a0bcd776d7ec953eb95cae3fc81783 100644
--- a/ui/display/chromeos/x11/display_util_x11.cc
+++ b/ui/display/chromeos/x11/display_util_x11.cc
@@ -5,6 +5,7 @@
#include "ui/display/chromeos/x11/display_util_x11.h"
#include "base/macros.h"
+#include "base/strings/string_util.h"
namespace ui {
@@ -30,7 +31,8 @@ const DisplayConnectionTypeMapping kDisplayConnectionTypeMapping[] = {
DisplayConnectionType GetDisplayConnectionTypeFromName(
const std::string& name) {
for (unsigned int i = 0; i < arraysize(kDisplayConnectionTypeMapping); ++i) {
- if (name.find(kDisplayConnectionTypeMapping[i].name) == 0) {
+ if (base::StartsWith(name, kDisplayConnectionTypeMapping[i].name,
+ base::CompareCase::SENSITIVE)) {
return kDisplayConnectionTypeMapping[i].type;
}
}
« no previous file with comments | « tools/android/forwarder2/host_forwarder_main.cc ('k') | ui/message_center/views/notification_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698