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

Side by Side Diff: chrome/browser/prefs/pref_service.cc

Issue 11368098: Draft change to use base::Closure instead of PrefObserver in PrefChangeRegistrar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 | Annotate | Revision Log
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/prefs/pref_service.h" 5 #include "chrome/browser/prefs/pref_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 return NULL; 762 return NULL;
763 } 763 }
764 const Value* value = pref->GetValue(); 764 const Value* value = pref->GetValue();
765 if (value->GetType() != Value::TYPE_LIST) { 765 if (value->GetType() != Value::TYPE_LIST) {
766 NOTREACHED(); 766 NOTREACHED();
767 return NULL; 767 return NULL;
768 } 768 }
769 return static_cast<const ListValue*>(value); 769 return static_cast<const ListValue*>(value);
770 } 770 }
771 771
772 void PrefService::AddPrefObserver(const char* path, PrefObserver* obs) { 772 void PrefService::AddPrefObserver(const char* path, const base::Closure& obs) {
773 pref_notifier_->AddPrefObserver(path, obs); 773 pref_notifier_->AddPrefObserver(path, obs);
774 } 774 }
775 775
776 void PrefService::RemovePrefObserver(const char* path, PrefObserver* obs) { 776 void PrefService::RemovePrefObserver(const char* path,
777 const base::Closure& obs) {
777 pref_notifier_->RemovePrefObserver(path, obs); 778 pref_notifier_->RemovePrefObserver(path, obs);
778 } 779 }
779 780
780 void PrefService::AddPrefInitObserver(base::Callback<void(bool)> obs) { 781 void PrefService::AddPrefInitObserver(base::Callback<void(bool)> obs) {
781 pref_notifier_->AddInitObserver(obs); 782 pref_notifier_->AddInitObserver(obs);
782 } 783 }
783 784
784 void PrefService::RegisterPreference(const char* path, 785 void PrefService::RegisterPreference(const char* path,
785 Value* default_value, 786 Value* default_value,
786 PrefSyncStatus sync_status) { 787 PrefSyncStatus sync_status) {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); 1060 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str());
1060 } 1061 }
1061 1062
1062 bool PrefService::Preference::IsUserModifiable() const { 1063 bool PrefService::Preference::IsUserModifiable() const {
1063 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); 1064 return pref_value_store()->PrefValueUserModifiable(name_.c_str());
1064 } 1065 }
1065 1066
1066 bool PrefService::Preference::IsExtensionModifiable() const { 1067 bool PrefService::Preference::IsExtensionModifiable() const {
1067 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str()); 1068 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str());
1068 } 1069 }
OLDNEW
« chrome/browser/api/prefs/pref_member.cc ('K') | « chrome/browser/prefs/pref_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698