Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1018)

Side by Side Diff: chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.cc

Issue 2705213002: Show different error message if ARC is disabled. (Closed)
Patch Set: Fix browsertests and add a new test for 904 Arc Disabled Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698