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

Unified Diff: chrome/browser/ui/webui/chromeos/login/l10n_util.cc

Issue 1715683002: chrome: Use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated as per latest code Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/l10n_util.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util.cc b/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
index 44e1148834e6b222a3e4a0534af0f7c5c0dcddd2..a8a37b7ea1dfaadd5b7686deca2312c6318c263f 100644
--- a/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
+++ b/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include <algorithm>
#include <iterator>
#include <map>
#include <set>
@@ -18,6 +17,7 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner.h"
+#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -153,9 +153,7 @@ scoped_ptr<base::ListValue> GetLanguageList(
if (lang.empty() || lang == language_id)
continue;
- if (std::find(base_language_codes.begin(),
- base_language_codes.end(),
- language_id) != base_language_codes.end()) {
+ if (ContainsValue(base_language_codes, language_id)) {
// Language is supported. No need to replace
continue;
}
@@ -163,9 +161,7 @@ scoped_ptr<base::ListValue> GetLanguageList(
if (!l10n_util::CheckAndResolveLocale(language_id, &resolved_locale))
continue;
- if (std::find(base_language_codes.begin(),
- base_language_codes.end(),
- resolved_locale) == base_language_codes.end()) {
+ if (!ContainsValue(base_language_codes, resolved_locale)) {
// Resolved locale is not supported.
continue;
}
@@ -188,11 +184,8 @@ scoped_ptr<base::ListValue> GetLanguageList(
it != language_codes.end(); ++it) {
// Exclude the language which is not in |base_langauge_codes| even it has
// input methods.
- if (std::find(base_language_codes.begin(),
- base_language_codes.end(),
- *it) == base_language_codes.end()) {
+ if (!ContainsValue(base_language_codes, *it))
continue;
- }
const base::string16 display_name =
l10n_util::GetDisplayNameForLocale(*it, app_locale, true);
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc ('k') | chrome/renderer/spellchecker/spellcheck.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698