| 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_robot_auth_code_fetcher.h" | 5 #include "chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 fetch_request_job_.reset(); | 74 fetch_request_job_.reset(); |
| 75 | 75 |
| 76 if (status == policy::DM_STATUS_SUCCESS && | 76 if (status == policy::DM_STATUS_SUCCESS && |
| 77 (!response.has_service_api_access_response())) { | 77 (!response.has_service_api_access_response())) { |
| 78 LOG(WARNING) << "Invalid service api access response."; | 78 LOG(WARNING) << "Invalid service api access response."; |
| 79 status = policy::DM_STATUS_RESPONSE_DECODING_ERROR; | 79 status = policy::DM_STATUS_RESPONSE_DECODING_ERROR; |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (status != policy::DM_STATUS_SUCCESS) { | 82 if (status != policy::DM_STATUS_SUCCESS) { |
| 83 LOG(ERROR) << "Fetching of robot auth code failed. DM Status: " << status; | 83 LOG(ERROR) << "Fetching of robot auth code failed. DM Status: " << status; |
| 84 callback.Run(std::string()); | 84 callback.Run(ArcAuthInfoFetcher::Status::FAILURE, std::string()); |
| 85 return; | 85 return; |
| 86 } | 86 } |
| 87 | 87 |
| 88 callback.Run(response.service_api_access_response().auth_code()); | 88 callback.Run(ArcAuthInfoFetcher::Status::SUCCESS, |
| 89 response.service_api_access_response().auth_code()); |
| 89 } | 90 } |
| 90 | 91 |
| 91 } // namespace arc | 92 } // namespace arc |
| OLD | NEW |