| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_ROBOT_AUTH_CODE_FETCHER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_ROBOT_AUTH_CODE_FETCHER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/chromeos/arc/auth/arc_auth_code_fetcher.h" |
| 14 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 15 |
| 16 namespace enterprise_management { |
| 17 class DeviceManagementResponse; |
| 18 } |
| 19 |
| 20 namespace policy { |
| 21 class DeviceManagementRequestJob; |
| 22 } |
| 23 |
| 24 namespace arc { |
| 25 |
| 26 // This class is responsible to fetch auth code for robot account. Robot auth |
| 27 // code is used for creation an account on Android side in ARC kiosk mode. |
| 28 class ArcRobotAuthCodeFetcher : public ArcAuthCodeFetcher { |
| 29 public: |
| 30 ArcRobotAuthCodeFetcher(); |
| 31 ~ArcRobotAuthCodeFetcher() override; |
| 32 |
| 33 // ArcAuthCodeFetcher: |
| 34 void Fetch(const FetchCallback& callback) override; |
| 35 |
| 36 private: |
| 37 void OnFetchRobotAuthCodeCompleted( |
| 38 FetchCallback callback, |
| 39 policy::DeviceManagementStatus status, |
| 40 int net_error, |
| 41 const enterprise_management::DeviceManagementResponse& response); |
| 42 |
| 43 std::unique_ptr<policy::DeviceManagementRequestJob> fetch_request_job_; |
| 44 base::WeakPtrFactory<ArcRobotAuthCodeFetcher> weak_ptr_factory_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ArcRobotAuthCodeFetcher); |
| 47 }; |
| 48 |
| 49 } // namespace arc |
| 50 |
| 51 #endif // CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_ROBOT_AUTH_CODE_FETCHER_H_ |
| OLD | NEW |