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

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

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: Revert IsIntentHelperAvailable fix. Created 3 years, 11 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.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index b765ba6573cb5089d4248811087ed757671c2011..c455443a50785f9c07908ebec725d0a291682080 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -20,6 +20,7 @@
#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_features.h"
+#include "components/arc/arc_util.h"
#include "content/public/browser/browser_thread.h"
namespace arc {
@@ -60,9 +61,8 @@ ProvisioningResult ConvertArcSignInFailureReasonToProvisioningResult(
}
mojom::ChromeAccountType GetAccountType() {
- return ArcSessionManager::IsArcKioskMode()
- ? mojom::ChromeAccountType::ROBOT_ACCOUNT
- : mojom::ChromeAccountType::USER_ACCOUNT;
+ return util::IsArcKioskMode() ? mojom::ChromeAccountType::ROBOT_ACCOUNT
+ : mojom::ChromeAccountType::USER_ACCOUNT;
}
} // namespace
@@ -188,7 +188,7 @@ void ArcAuthService::GetAuthCodeDeprecated(
const GetAuthCodeDeprecatedCallback& callback) {
// For robot account we must use RequestAccountInfo because it allows
// to specify account type.
- DCHECK(!ArcSessionManager::IsArcKioskMode());
+ DCHECK(!util::IsArcKioskMode());
RequestAccountInfoInternal(
base::MakeUnique<ArcAuthService::AccountInfoNotifier>(callback));
}
@@ -213,7 +213,7 @@ void ArcAuthService::RequestAccountInfoInternal(
DCHECK(!notifier_);
DCHECK(!fetcher_);
- if (ArcSessionManager::IsOptInVerificationDisabled()) {
+ if (util::IsOptInVerificationDisabled()) {
notifier->Notify(
false /* = is_enforced */, std::string(), GetAccountType(),
policy_util::IsAccountManaged(ArcSessionManager::Get()->profile()));
@@ -223,7 +223,7 @@ void ArcAuthService::RequestAccountInfoInternal(
// Hereafter asynchronous operation. Remember the notifier.
notifier_ = std::move(notifier);
- if (ArcSessionManager::IsArcKioskMode()) {
+ if (util::IsArcKioskMode()) {
// In Kiosk mode, use Robot auth code fetching.
fetcher_ = base::MakeUnique<ArcRobotAuthCodeFetcher>();
} else if (base::FeatureList::IsEnabled(arc::kArcUseAuthEndpointFeature)) {
@@ -258,8 +258,7 @@ void ArcAuthService::OnAuthCodeFetched(const std::string& auth_code) {
}
notifier_->Notify(
- !ArcSessionManager::IsOptInVerificationDisabled(), auth_code,
- GetAccountType(),
+ !util::IsOptInVerificationDisabled(), auth_code, GetAccountType(),
policy_util::IsAccountManaged(ArcSessionManager::Get()->profile()));
notifier_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698