OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 if (pref->GetType() != new_value->GetType()) { | 829 if (pref->GetType() != new_value->GetType()) { |
830 NOTREACHED() << "Trying to set pref " << path | 830 NOTREACHED() << "Trying to set pref " << path |
831 << " of type " << pref->GetType() | 831 << " of type " << pref->GetType() |
832 << " to value of type " << new_value->GetType(); | 832 << " to value of type " << new_value->GetType(); |
833 return; | 833 return; |
834 } | 834 } |
835 | 835 |
836 user_pref_store_->SetValue(path, owned_value.release()); | 836 user_pref_store_->SetValue(path, owned_value.release()); |
837 } | 837 } |
838 | 838 |
839 SyncableService* PrefService::GetSyncableService() { | 839 PrefModelAssociator* PrefService::GetSyncableService() { |
840 return pref_sync_associator_.get(); | 840 return pref_sync_associator_.get(); |
841 } | 841 } |
842 | 842 |
843 /////////////////////////////////////////////////////////////////////////////// | 843 /////////////////////////////////////////////////////////////////////////////// |
844 // PrefService::Preference | 844 // PrefService::Preference |
845 | 845 |
846 PrefService::Preference::Preference(const PrefService* service, | 846 PrefService::Preference::Preference(const PrefService* service, |
847 const char* name, | 847 const char* name, |
848 base::Value::Type type) | 848 base::Value::Type type) |
849 : name_(name), | 849 : name_(name), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); | 896 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); |
897 } | 897 } |
898 | 898 |
899 bool PrefService::Preference::IsUserModifiable() const { | 899 bool PrefService::Preference::IsUserModifiable() const { |
900 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); | 900 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); |
901 } | 901 } |
902 | 902 |
903 bool PrefService::Preference::IsExtensionModifiable() const { | 903 bool PrefService::Preference::IsExtensionModifiable() const { |
904 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str()); | 904 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str()); |
905 } | 905 } |
OLD | NEW |