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

Side by Side Diff: components/sync_driver/sync_prefs.cc

Issue 1586563004: [Sync] Don't set sync requested when setting setup completed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/sync_driver/sync_prefs.h" 5 #include "components/sync_driver/sync_prefs.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_member.h" 9 #include "base/prefs/pref_member.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 bool SyncPrefs::HasSyncSetupCompleted() const { 124 bool SyncPrefs::HasSyncSetupCompleted() const {
125 DCHECK(CalledOnValidThread()); 125 DCHECK(CalledOnValidThread());
126 return pref_service_->GetBoolean(prefs::kSyncHasSetupCompleted); 126 return pref_service_->GetBoolean(prefs::kSyncHasSetupCompleted);
127 } 127 }
128 128
129 void SyncPrefs::SetSyncSetupCompleted() { 129 void SyncPrefs::SetSyncSetupCompleted() {
130 DCHECK(CalledOnValidThread()); 130 DCHECK(CalledOnValidThread());
131 pref_service_->SetBoolean(prefs::kSyncHasSetupCompleted, true); 131 pref_service_->SetBoolean(prefs::kSyncHasSetupCompleted, true);
132 SetSyncRequested(true);
Nicolas Zea 2016/01/15 21:21:19 Does it make sense to DCHECK that sync was already
maxbogue 2016/01/20 18:31:55 Not really any reason to. I think it will be easie
133 } 132 }
134 133
135 bool SyncPrefs::SyncHasAuthError() const { 134 bool SyncPrefs::SyncHasAuthError() const {
136 DCHECK(CalledOnValidThread()); 135 DCHECK(CalledOnValidThread());
137 return pref_service_->GetBoolean(prefs::kSyncHasAuthError); 136 return pref_service_->GetBoolean(prefs::kSyncHasAuthError);
138 } 137 }
139 138
140 void SyncPrefs::SetSyncAuthError(bool error) { 139 void SyncPrefs::SetSyncAuthError(bool error) {
141 DCHECK(CalledOnValidThread()); 140 DCHECK(CalledOnValidThread());
142 pref_service_->SetBoolean(prefs::kSyncHasAuthError, error); 141 pref_service_->SetBoolean(prefs::kSyncHasAuthError, error);
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 return scoped_ptr<syncer::SyncEncryptionHandler::NigoriState>(); 554 return scoped_ptr<syncer::SyncEncryptionHandler::NigoriState>();
556 555
557 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> result( 556 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> result(
558 new syncer::SyncEncryptionHandler::NigoriState()); 557 new syncer::SyncEncryptionHandler::NigoriState());
559 if (!result->nigori_specifics.ParseFromString(decoded)) 558 if (!result->nigori_specifics.ParseFromString(decoded))
560 return scoped_ptr<syncer::SyncEncryptionHandler::NigoriState>(); 559 return scoped_ptr<syncer::SyncEncryptionHandler::NigoriState>();
561 return result; 560 return result;
562 } 561 }
563 562
564 } // namespace sync_driver 563 } // namespace sync_driver
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698