| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 782 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
| 783 return !disable_restrictive_proxy_check_for_test_ && | 783 return !disable_restrictive_proxy_check_for_test_ && |
| 784 !IsOnline(captive_portal_status_); | 784 !IsOnline(captive_portal_status_); |
| 785 } | 785 } |
| 786 | 786 |
| 787 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { | 787 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { |
| 788 disable_restrictive_proxy_check_for_test_ = true; | 788 disable_restrictive_proxy_check_for_test_ = true; |
| 789 } | 789 } |
| 790 | 790 |
| 791 } // namespace chromeos | 791 } // namespace chromeos |
| OLD | NEW |