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

Unified Diff: components/signin/core/browser/account_reconcilor.cc

Issue 1104153002: Expose ReconcilorState. Rename MergeSession in Signin Tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fail at ListAccounts with a non-transient error. Created 5 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: components/signin/core/browser/account_reconcilor.cc
diff --git a/components/signin/core/browser/account_reconcilor.cc b/components/signin/core/browser/account_reconcilor.cc
index aecbe9b19ad2e548582749410a6d16acc6b53ee8..a3aefc9c098a35af23e0162277121f453817f6fb 100644
--- a/components/signin/core/browser/account_reconcilor.cc
+++ b/components/signin/core/browser/account_reconcilor.cc
@@ -64,6 +64,7 @@ AccountReconcilor::AccountReconcilor(
registered_with_content_settings_(false),
is_reconcile_started_(false),
first_execution_(true),
+ error_during_last_reconcile_(false),
chrome_accounts_changed_(false) {
VLOG(1) << "AccountReconcilor::AccountReconcilor";
}
@@ -176,6 +177,18 @@ bool AccountReconcilor::IsProfileConnected() {
return signin_manager_->IsAuthenticated();
}
+AccountReconcilor::State AccountReconcilor::GetState() {
+ if (!is_reconcile_started_) {
+ return error_during_last_reconcile_
+ ? AccountReconcilor::State::NOT_RECONCILING_ERROR_OCCURED
+ : AccountReconcilor::State::NOT_RECONCILING;
+ }
+
+ return add_to_cookie_.empty()
+ ? AccountReconcilor::State::GATHERING_INFORMATION
+ : AccountReconcilor::State::APPLYING_CHANGES;
+}
+
void AccountReconcilor::OnContentSettingChanged(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
@@ -249,6 +262,7 @@ void AccountReconcilor::StartReconcile() {
return;
is_reconcile_started_ = true;
+ error_during_last_reconcile_ = false;
// Reset state for validating gaia cookie.
gaia_accounts_.clear();
@@ -278,6 +292,8 @@ void AccountReconcilor::OnGaiaAccountsInCookieUpdated(
is_reconcile_started_ ? FinishReconcile() : StartReconcile();
} else {
+ if (is_reconcile_started_)
+ error_during_last_reconcile_ = true;
AbortReconcile();
}
}
@@ -434,6 +450,8 @@ void AccountReconcilor::OnAddAccountToCookieCompleted(
const GoogleServiceAuthError& error) {
// Always listens to GaiaCookieManagerService. Only proceed if reconciling.
Roger Tawa OOO till Jul 10th 2015/04/27 20:08:49 Nit: can you add a VLOG here?
Mike Lerman 2015/04/27 20:16:49 Done.
if (is_reconcile_started_ && MarkAccountAsAddedToCookie(account_id)) {
+ if (error.state() != GoogleServiceAuthError::State::NONE)
+ error_during_last_reconcile_ = true;
CalculateIfReconcileIsDone();
ScheduleStartReconcileIfChromeAccountsChanged();
}
« no previous file with comments | « components/signin/core/browser/account_reconcilor.h ('k') | components/signin/core/browser/signin_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698