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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.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, 10 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 "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
6 6
7 #include "ash/system/chromeos/devicetype_utils.h" 7 #include "ash/system/chromeos/devicetype_utils.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/stl_util.h"
12 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
13 #include "base/values.h" 14 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browser_shutdown.h" 16 #include "chrome/browser/browser_shutdown.h"
16 #include "chrome/browser/chromeos/input_method/input_method_util.h" 17 #include "chrome/browser/chromeos/input_method/input_method_util.h"
17 #include "chrome/browser/chromeos/language_preferences.h" 18 #include "chrome/browser/chromeos/language_preferences.h"
18 #include "chrome/browser/chromeos/login/screens/network_error.h" 19 #include "chrome/browser/chromeos/login/screens/network_error.h"
19 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" 20 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
20 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 21 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
21 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" 22 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return; 119 return;
119 120
120 io_thread->ClearHostCache(); 121 io_thread->ClearHostCache();
121 } 122 }
122 123
123 void PushFrontIMIfNotExists(const std::string& input_method, 124 void PushFrontIMIfNotExists(const std::string& input_method,
124 std::vector<std::string>* input_methods) { 125 std::vector<std::string>* input_methods) {
125 if (input_method.empty()) 126 if (input_method.empty())
126 return; 127 return;
127 128
128 if (std::find(input_methods->begin(), input_methods->end(), input_method) == 129 if (!ContainsValue(*input_methods, input_method))
129 input_methods->end())
130 input_methods->insert(input_methods->begin(), input_method); 130 input_methods->insert(input_methods->begin(), input_method);
131 } 131 }
132 132
133 bool IsOnline(NetworkPortalDetector::CaptivePortalStatus status) { 133 bool IsOnline(NetworkPortalDetector::CaptivePortalStatus status) {
134 return status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; 134 return status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE;
135 } 135 }
136 136
137 } // namespace 137 } // namespace
138 138
139 // A class that's used to specify the way how Gaia should be loaded. 139 // A class that's used to specify the way how Gaia should be loaded.
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 bool GaiaScreenHandler::IsRestrictiveProxy() const { 792 bool GaiaScreenHandler::IsRestrictiveProxy() const {
793 return !disable_restrictive_proxy_check_for_test_ && 793 return !disable_restrictive_proxy_check_for_test_ &&
794 !IsOnline(captive_portal_status_); 794 !IsOnline(captive_portal_status_);
795 } 795 }
796 796
797 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { 797 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() {
798 disable_restrictive_proxy_check_for_test_ = true; 798 disable_restrictive_proxy_check_for_test_ = true;
799 } 799 }
800 800
801 } // namespace chromeos 801 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698