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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 6 years 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 "chrome/browser/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2483 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 2494
2495 SigninManagerBase* ProfileSyncService::signin() const { 2495 SigninManagerBase* ProfileSyncService::signin() const {
2496 if (!signin_) 2496 if (!signin_)
2497 return NULL; 2497 return NULL;
2498 return signin_->GetOriginal(); 2498 return signin_->GetOriginal();
2499 } 2499 }
2500 2500
2501 void ProfileSyncService::UnsuppressAndStart() { 2501 void ProfileSyncService::UnsuppressAndStart() {
2502 DCHECK(profile_); 2502 DCHECK(profile_);
2503 sync_prefs_.SetStartSuppressed(false); 2503 sync_prefs_.SetStartSuppressed(false);
2504 if (signin_.get() && !signin_->GetOriginal()->IsAuthenticated()) { 2504 DCHECK(!signin_.get() || signin_->GetOriginal()->IsAuthenticated());
2505 signin_->GetOriginal()->SetAuthenticatedUsername(
2506 profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
2507 }
2508 startup_controller_.TryStart(); 2505 startup_controller_.TryStart();
2509 } 2506 }
2510 2507
2511 void ProfileSyncService::AcknowledgeSyncedTypes() { 2508 void ProfileSyncService::AcknowledgeSyncedTypes() {
2512 sync_prefs_.AcknowledgeSyncedTypes(GetRegisteredDataTypes()); 2509 sync_prefs_.AcknowledgeSyncedTypes(GetRegisteredDataTypes());
2513 } 2510 }
2514 2511
2515 void ProfileSyncService::ReconfigureDatatypeManager() { 2512 void ProfileSyncService::ReconfigureDatatypeManager() {
2516 // If we haven't initialized yet, don't configure the DTM as it could cause 2513 // If we haven't initialized yet, don't configure the DTM as it could cause
2517 // association to start before a Directory has even been created. 2514 // association to start before a Directory has even been created.
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2762 2759
2763 base::MessageLoop* ProfileSyncService::GetSyncLoopForTest() const { 2760 base::MessageLoop* ProfileSyncService::GetSyncLoopForTest() const {
2764 if (sync_thread_) { 2761 if (sync_thread_) {
2765 return sync_thread_->message_loop(); 2762 return sync_thread_->message_loop();
2766 } else if (backend_) { 2763 } else if (backend_) {
2767 return backend_->GetSyncLoopForTesting(); 2764 return backend_->GetSyncLoopForTesting();
2768 } else { 2765 } else {
2769 return NULL; 2766 return NULL;
2770 } 2767 }
2771 } 2768 }
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698