OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |