| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "extensions/browser/api/networking_config/networking_config_api.h" | 9 #include "extensions/browser/api/networking_config/networking_config_api.h" |
| 10 #include "extensions/browser/api/networking_config/networking_config_service.h" | 10 #include "extensions/browser/api/networking_config/networking_config_service.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 EXTENSION_FUNCTION_VALIDATE(parameters_.get()); | 82 EXTENSION_FUNCTION_VALIDATE(parameters_.get()); |
| 83 | 83 |
| 84 NetworkingConfigService* service = | 84 NetworkingConfigService* service = |
| 85 NetworkingConfigServiceFactory::GetForBrowserContext(browser_context()); | 85 NetworkingConfigServiceFactory::GetForBrowserContext(browser_context()); |
| 86 DCHECK(service); | 86 DCHECK(service); |
| 87 | 87 |
| 88 const NetworkingConfigService::AuthenticationResult& last_result = | 88 const NetworkingConfigService::AuthenticationResult& last_result = |
| 89 service->GetAuthenticationResult(); | 89 service->GetAuthenticationResult(); |
| 90 if (last_result.authentication_state != NetworkingConfigService::NOTRY || | 90 if (last_result.authentication_state != NetworkingConfigService::NOTRY || |
| 91 last_result.guid != parameters_->guid) { | 91 last_result.guid != parameters_->guid) { |
| 92 RespondNow(Error(kAuthenticationResultFailed)); | 92 return RespondNow(Error(kAuthenticationResultFailed)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 // Populate NetworkingCaptivePortalAPI::AuthenticationResult. | 95 // Populate NetworkingCaptivePortalAPI::AuthenticationResult. |
| 96 NetworkingConfigService::AuthenticationResult authentication_result = { | 96 NetworkingConfigService::AuthenticationResult authentication_result = { |
| 97 extension_id(), parameters_->guid, NetworkingConfigService::FAILED, | 97 extension_id(), parameters_->guid, NetworkingConfigService::FAILED, |
| 98 }; | 98 }; |
| 99 switch (parameters_->result) { | 99 switch (parameters_->result) { |
| 100 case core_api::networking_config::AUTHENTICATION_RESULT_NONE: | 100 case core_api::networking_config::AUTHENTICATION_RESULT_NONE: |
| 101 NOTREACHED(); | 101 NOTREACHED(); |
| 102 break; | 102 break; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 119 } | 119 } |
| 120 service->SetAuthenticationResult(authentication_result); | 120 service->SetAuthenticationResult(authentication_result); |
| 121 return RespondNow(NoArguments()); | 121 return RespondNow(NoArguments()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 NetworkingConfigFinishAuthenticationFunction:: | 124 NetworkingConfigFinishAuthenticationFunction:: |
| 125 ~NetworkingConfigFinishAuthenticationFunction() { | 125 ~NetworkingConfigFinishAuthenticationFunction() { |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace extensions | 128 } // namespace extensions |
| OLD | NEW |