| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 fetch_request_job_.reset(); | 72 fetch_request_job_.reset(); |
| 73 | 73 |
| 74 if (status == policy::DM_STATUS_SUCCESS && | 74 if (status == policy::DM_STATUS_SUCCESS && |
| 75 (!response.has_service_api_access_response())) { | 75 (!response.has_service_api_access_response())) { |
| 76 LOG(WARNING) << "Invalid service api access response."; | 76 LOG(WARNING) << "Invalid service api access response."; |
| 77 status = policy::DM_STATUS_RESPONSE_DECODING_ERROR; | 77 status = policy::DM_STATUS_RESPONSE_DECODING_ERROR; |
| 78 } | 78 } |
| 79 | 79 |
| 80 if (status != policy::DM_STATUS_SUCCESS) { | 80 if (status != policy::DM_STATUS_SUCCESS) { |
| 81 LOG(ERROR) << "Fetching of robot auth code failed. DM Status: " << status; | 81 LOG(ERROR) << "Fetching of robot auth code failed. DM Status: " << status; |
| 82 callback.Run(std::string()); | 82 callback.Run(ArcAuthInfoFetchStatus::FAILURE, std::string()); |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 | 85 |
| 86 callback.Run(response.service_api_access_response().auth_code()); | 86 callback.Run(ArcAuthInfoFetchStatus::SUCCESS, |
| 87 response.service_api_access_response().auth_code()); |
| 87 } | 88 } |
| 88 | 89 |
| 89 } // namespace arc | 90 } // namespace arc |
| OLD | NEW |