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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.h

Issue 1892873002: Add CheckAndroidManagement to ARC sign-in flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@check_android_management
Patch Set: Added browser test for ArcAuthService. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_auth_service.h
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.h b/chrome/browser/chromeos/arc/arc_auth_service.h
index cd20eaf7598f4c4a94a6920282fa820373ce1faf..92a57574c8f6e887fd72e157a97e302e253dc797 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.h
+++ b/chrome/browser/chromeos/arc/arc_auth_service.h
@@ -6,9 +6,11 @@
#define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_
#include <ostream>
+#include <string>
#include "base/macros.h"
#include "base/observer_list.h"
+#include "chrome/browser/chromeos/policy/android_management_client.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_service.h"
#include "components/arc/common/auth.mojom.h"
@@ -88,6 +90,8 @@ class ArcAuthService : public ArcService,
// Checks if OptIn verification was disabled by switch in command line.
static bool IsOptInVerificationDisabled();
+ static void EnableCheckAndroidManagementForTesting();
+
void OnPrimaryUserProfilePrepared(Profile* profile);
void Shutdown();
@@ -146,6 +150,12 @@ class ArcAuthService : public ArcService,
// Returns current page status, relevant to the specific page.
const base::string16& ui_page_status() { return ui_page_status_; }
+ // Set auth_token only for testing when check Android management is enabled
+ // for testing.
+ void set_auth_token_for_testing(const std::string& auth_token) {
+ auth_token_ = auth_token;
+ }
+
private:
void StartArc();
void PrepareContext();
@@ -159,6 +169,10 @@ class ArcAuthService : public ArcService,
void OnOptInPreferenceChanged();
void StartUI();
void OnPrepareContextFailed();
+ void StartAndroidManagementClient();
+ void CheckAndroidManagement();
+ void OnAndroidManagementChecked(
+ policy::AndroidManagementClient::Result result);
// Unowned pointer. Keeps current profile.
Profile* profile_ = nullptr;
@@ -180,6 +194,9 @@ class ArcAuthService : public ArcService,
bool context_prepared_ = false;
UIPage ui_page_ = UIPage::NO_PAGE;
base::string16 ui_page_status_;
+ std::string auth_token_;
+
+ std::unique_ptr<policy::AndroidManagementClient> android_management_client_;
DISALLOW_COPY_AND_ASSIGN(ArcAuthService);
};

Powered by Google App Engine
This is Rietveld 408576698