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

Side by Side Diff: components/browser_sync/profile_sync_service.cc

Issue 2953253002: [DICE] Enable sync for an account that is already present in the token service. (Closed)
Patch Set: Prepare for review Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/browser_sync/profile_sync_service.h" 5 #include "components/browser_sync/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <map> 10 #include <map>
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 // engine starts up. 1954 // engine starts up.
1955 crypto_->ConsumeCachedPassphraseIfPossible(); 1955 crypto_->ConsumeCachedPassphraseIfPossible();
1956 } 1956 }
1957 #if defined(OS_CHROMEOS) 1957 #if defined(OS_CHROMEOS)
1958 RefreshSpareBootstrapToken(password); 1958 RefreshSpareBootstrapToken(password);
1959 #endif 1959 #endif
1960 if (!IsEngineInitialized() || GetAuthError().state() != AuthError::NONE) { 1960 if (!IsEngineInitialized() || GetAuthError().state() != AuthError::NONE) {
1961 // Track the fact that we're still waiting for auth to complete. 1961 // Track the fact that we're still waiting for auth to complete.
1962 is_auth_in_progress_ = true; 1962 is_auth_in_progress_ = true;
1963 } 1963 }
1964
1965 if (oauth2_token_service_->RefreshTokenIsAvailable(account_id)) {
1966 // Start sync if the refresh token is already available in the token service
1967 // when the authenticated account is set.
1968 OnRefreshTokenAvailable(account_id);
1969 }
1964 } 1970 }
1965 1971
1966 void ProfileSyncService::GoogleSignedOut(const std::string& account_id, 1972 void ProfileSyncService::GoogleSignedOut(const std::string& account_id,
1967 const std::string& username) { 1973 const std::string& username) {
1968 DCHECK(thread_checker_.CalledOnValidThread()); 1974 DCHECK(thread_checker_.CalledOnValidThread());
1969 sync_disabled_by_admin_ = false; 1975 sync_disabled_by_admin_ = false;
1970 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", syncer::SIGN_OUT, 1976 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", syncer::SIGN_OUT,
1971 syncer::STOP_SOURCE_LIMIT); 1977 syncer::STOP_SOURCE_LIMIT);
1972 RequestStop(CLEAR_DATA); 1978 RequestStop(CLEAR_DATA);
1973 } 1979 }
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 return; 2434 return;
2429 2435
2430 DCHECK(startup_controller_->IsSetupInProgress()); 2436 DCHECK(startup_controller_->IsSetupInProgress());
2431 startup_controller_->SetSetupInProgress(false); 2437 startup_controller_->SetSetupInProgress(false);
2432 2438
2433 if (IsEngineInitialized()) 2439 if (IsEngineInitialized())
2434 ReconfigureDatatypeManager(); 2440 ReconfigureDatatypeManager();
2435 NotifyObservers(); 2441 NotifyObservers();
2436 } 2442 }
2437 } // namespace browser_sync 2443 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698