| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/arc/auth/arc_background_auth_code_fetcher.h" | 5 #include "chrome/browser/chromeos/arc/auth/arc_background_auth_code_fetcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 void ArcBackgroundAuthCodeFetcher::ResetFetchers() { | 176 void ArcBackgroundAuthCodeFetcher::ResetFetchers() { |
| 177 login_token_request_.reset(); | 177 login_token_request_.reset(); |
| 178 auth_code_fetcher_.reset(); | 178 auth_code_fetcher_.reset(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void ArcBackgroundAuthCodeFetcher::ReportResult( | 181 void ArcBackgroundAuthCodeFetcher::ReportResult( |
| 182 const std::string& auth_code, | 182 const std::string& auth_code, |
| 183 OptInSilentAuthCode uma_status) { | 183 OptInSilentAuthCode uma_status) { |
| 184 UpdateSilentAuthCodeUMA(uma_status); | 184 UpdateSilentAuthCodeUMA(uma_status); |
| 185 base::ResetAndReturn(&callback_).Run(auth_code); | 185 base::ResetAndReturn(&callback_) |
| 186 .Run(auth_code.empty() ? ArcAuthInfoFetcher::Status::FAILURE |
| 187 : ArcAuthInfoFetcher::Status::SUCCESS, |
| 188 auth_code); |
| 186 } | 189 } |
| 187 | 190 |
| 188 } // namespace arc | 191 } // namespace arc |
| OLD | NEW |