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

Side by Side Diff: components/sync/base/sync_prefs.cc

Issue 2424673002: Remove usage of FOR_EACH_OBSERVER macro in components/sync (Closed)
Patch Set: blank line before return Created 4 years, 2 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 | components/sync/device_info/device_info_service.cc » ('j') | 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/base/sync_prefs.h" 5 #include "components/sync/base/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/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 void SyncPrefs::SetSpareBootstrapToken(const std::string& token) { 336 void SyncPrefs::SetSpareBootstrapToken(const std::string& token) {
337 DCHECK(CalledOnValidThread()); 337 DCHECK(CalledOnValidThread());
338 pref_service_->SetString(prefs::kSyncSpareBootstrapToken, token); 338 pref_service_->SetString(prefs::kSyncSpareBootstrapToken, token);
339 } 339 }
340 #endif 340 #endif
341 341
342 void SyncPrefs::OnSyncManagedPrefChanged() { 342 void SyncPrefs::OnSyncManagedPrefChanged() {
343 DCHECK(CalledOnValidThread()); 343 DCHECK(CalledOnValidThread());
344 FOR_EACH_OBSERVER(SyncPrefObserver, sync_pref_observers_, 344 for (auto& observer : sync_pref_observers_)
345 OnSyncManagedPrefChange(*pref_sync_managed_)); 345 observer.OnSyncManagedPrefChange(*pref_sync_managed_);
346 } 346 }
347 347
348 void SyncPrefs::SetManagedForTest(bool is_managed) { 348 void SyncPrefs::SetManagedForTest(bool is_managed) {
349 DCHECK(CalledOnValidThread()); 349 DCHECK(CalledOnValidThread());
350 pref_service_->SetBoolean(prefs::kSyncManaged, is_managed); 350 pref_service_->SetBoolean(prefs::kSyncManaged, is_managed);
351 } 351 }
352 352
353 void SyncPrefs::RegisterPrefGroups() { 353 void SyncPrefs::RegisterPrefGroups() {
354 pref_groups_[APPS].Put(APP_NOTIFICATIONS); 354 pref_groups_[APPS].Put(APP_NOTIFICATIONS);
355 pref_groups_[APPS].Put(APP_SETTINGS); 355 pref_groups_[APPS].Put(APP_SETTINGS);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 sync_pb::NigoriSpecifics* nigori_specifics) const { 540 sync_pb::NigoriSpecifics* nigori_specifics) const {
541 const std::string encoded = 541 const std::string encoded =
542 pref_service_->GetString(prefs::kSyncNigoriStateForPassphraseTransition); 542 pref_service_->GetString(prefs::kSyncNigoriStateForPassphraseTransition);
543 std::string decoded; 543 std::string decoded;
544 if (base::Base64Decode(encoded, &decoded)) { 544 if (base::Base64Decode(encoded, &decoded)) {
545 nigori_specifics->ParseFromString(decoded); 545 nigori_specifics->ParseFromString(decoded);
546 } 546 }
547 } 547 }
548 548
549 } // namespace syncer 549 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | components/sync/device_info/device_info_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698