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

Unified Diff: chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h

Issue 2547073002: Fix race issue in ArcAuthService. (Closed)
Patch Set: Address comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h
diff --git a/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h b/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdf02d76720082678d0b6d47b84412a368a5d530
--- /dev/null
+++ b/chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_ROBOT_AUTH_CODE_FETCHER_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_ROBOT_AUTH_CODE_FETCHER_H_
+
+#include <memory>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/arc/auth/arc_auth_code_fetcher.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+
+namespace enterprise_management {
+class DeviceManagementResponse;
+}
+
+namespace policy {
+class DeviceManagementRequestJob;
+}
+
+namespace arc {
+
+// This class is responsible to fetch auth code for robot account. Robot auth
+// code is used for creation an account on Android side in ARC kiosk mode.
+class ArcRobotAuthCodeFetcher : public ArcAuthCodeFetcher {
+ public:
+ ArcRobotAuthCodeFetcher();
+ ~ArcRobotAuthCodeFetcher() override;
+
+ // ArcAuthCodeFetcher:
+ void Fetch(const FetchCallback& callback) override;
+
+ private:
+ void OnFetchRobotAuthCodeCompleted(
+ FetchCallback callback,
+ policy::DeviceManagementStatus status,
+ int net_error,
+ const enterprise_management::DeviceManagementResponse& response);
+
+ std::unique_ptr<policy::DeviceManagementRequestJob> fetch_request_job_;
+ base::WeakPtrFactory<ArcRobotAuthCodeFetcher> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcRobotAuthCodeFetcher);
+};
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_ROBOT_AUTH_CODE_FETCHER_H_

Powered by Google App Engine
This is Rietveld 408576698