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

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

Issue 2255673004: Revert of [M53 cherry-pick] Migrate ArcUserDataService into ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 d737405de594758883b6a65b24cdb9e41b4a3477..476ca3808a905c6d49cc96efc72cf765921277ab 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -237,52 +237,13 @@
// user noticing.
OnSignInFailedInternal(ProvisioningResult::ARC_STOPPED);
}
-
- if (clear_required_) {
- // This should be always true, but just in case as this is looked at
- // inside RemoveArcData() at first.
- DCHECK(arc_bridge_service()->stopped());
- RemoveArcData();
- } else {
- // To support special "Stop and enable ARC" procedure for enterprise,
- // here call OnArcDataRemoved(true) as if the data removal is successfully
- // done.
- // TODO(hidehiko): Restructure the code.
- OnArcDataRemoved(true);
- }
-}
-
-void ArcAuthService::RemoveArcData() {
- if (!arc_bridge_service()->stopped()) {
- // Just set a flag. On bridge stopped, this will be re-called,
- // then session manager should remove the data.
- clear_required_ = true;
- return;
- }
+ if (!clear_required_)
+ return;
clear_required_ = false;
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->RemoveArcData(
cryptohome::Identification(
multi_user_util::GetAccountIdFromProfile(profile_)),
- base::Bind(&ArcAuthService::OnArcDataRemoved,
- weak_ptr_factory_.GetWeakPtr()));
-}
-
-void ArcAuthService::OnArcDataRemoved(bool success) {
- LOG_IF(ERROR, !success) << "Required ARC user data wipe failed.";
-
- // Here check if |reenable_arc_| is marked or not.
- // The only case this happens should be in the special case for enterprise
- // "on managed lost" case. In that case, OnBridgeStopped() should trigger
- // the RemoveArcData(), then this.
- // TODO(hidehiko): Restructure the code.
- if (!reenable_arc_)
- return;
-
- // Restart ARC anyway. Let the enterprise reporting instance decide whether
- // the ARC user data wipe is still required or not.
- reenable_arc_ = false;
- VLOG(1) << "Reenable ARC";
- EnableArc();
+ chromeos::SessionManagerClient::ArcCallback());
}
std::string ArcAuthService::GetAndResetAuthCode() {
@@ -394,7 +355,7 @@
result == ProvisioningResult::CLOUD_PROVISION_FLOW_TIMEOUT ||
result == ProvisioningResult::CLOUD_PROVISION_FLOW_INTERNAL_ERROR ||
result == ProvisioningResult::UNKNOWN_ERROR)
- RemoveArcData();
+ clear_required_ = true;
// We'll delay shutting down the bridge in this case to allow people to send
// feedback.
@@ -457,7 +418,6 @@
if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) {
OnOptInPreferenceChanged();
} else {
- RemoveArcData();
UpdateEnabledStateUMA(false);
PrefServiceSyncableFromProfile(profile_)->AddObserver(this);
OnIsSyncingChanged();
@@ -568,7 +528,6 @@
if (!arc_enabled) {
StopArc();
- RemoveArcData();
return;
}
@@ -637,15 +596,6 @@
ui_page_status_ = status;
FOR_EACH_OBSERVER(Observer, observer_list_,
OnOptInUIShowPage(ui_page_, ui_page_status_));
-}
-
-// This is the special method to support enterprise mojo API.
-// TODO(hidehiko): Remove this.
-void ArcAuthService::StopAndEnableArc() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- DCHECK(!arc_bridge_service()->stopped());
- reenable_arc_ = true;
- StopArc();
}
void ArcAuthService::StartArc() {
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/chromeos/arc/arc_auth_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698