| OLD | NEW |
| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 return; | 154 return; |
| 154 | 155 |
| 155 io_thread->ClearHostCache(); | 156 io_thread->ClearHostCache(); |
| 156 } | 157 } |
| 157 | 158 |
| 158 void PushFrontIMIfNotExists(const std::string& input_method, | 159 void PushFrontIMIfNotExists(const std::string& input_method, |
| 159 std::vector<std::string>* input_methods) { | 160 std::vector<std::string>* input_methods) { |
| 160 if (input_method.empty()) | 161 if (input_method.empty()) |
| 161 return; | 162 return; |
| 162 | 163 |
| 163 if (std::find(input_methods->begin(), input_methods->end(), input_method) == | 164 if (!ContainsValue(*input_methods, input_method)) |
| 164 input_methods->end()) | |
| 165 input_methods->insert(input_methods->begin(), input_method); | 165 input_methods->insert(input_methods->begin(), input_method); |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool IsOnline(NetworkPortalDetector::CaptivePortalStatus status) { | 168 bool IsOnline(NetworkPortalDetector::CaptivePortalStatus status) { |
| 169 return status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | 169 return status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace | 172 } // namespace |
| 173 | 173 |
| 174 // A class that's used to specify the way how Gaia should be loaded. | 174 // A class that's used to specify the way how Gaia should be loaded. |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 826 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
| 827 return !disable_restrictive_proxy_check_for_test_ && | 827 return !disable_restrictive_proxy_check_for_test_ && |
| 828 !IsOnline(captive_portal_status_); | 828 !IsOnline(captive_portal_status_); |
| 829 } | 829 } |
| 830 | 830 |
| 831 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { | 831 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { |
| 832 disable_restrictive_proxy_check_for_test_ = true; | 832 disable_restrictive_proxy_check_for_test_ = true; |
| 833 } | 833 } |
| 834 | 834 |
| 835 } // namespace chromeos | 835 } // namespace chromeos |
| OLD | NEW |