| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 NOTREACHED() << "Trying to set pref " << path | 572 NOTREACHED() << "Trying to set pref " << path |
| 573 << " of type " << pref->GetType() | 573 << " of type " << pref->GetType() |
| 574 << " to value of type " << new_value->GetType(); | 574 << " to value of type " << new_value->GetType(); |
| 575 return; | 575 return; |
| 576 } | 576 } |
| 577 | 577 |
| 578 if (pref_value_store_->SetUserPrefValue(path, new_value)) | 578 if (pref_value_store_->SetUserPrefValue(path, new_value)) |
| 579 pref_notifier_->OnUserPreferenceSet(path); | 579 pref_notifier_->OnUserPreferenceSet(path); |
| 580 } | 580 } |
| 581 | 581 |
| 582 PrefStore* PrefService::GetExtensionPrefStore() const { |
| 583 return pref_value_store()->GetExtensionPrefStore(); |
| 584 } |
| 585 |
| 582 /////////////////////////////////////////////////////////////////////////////// | 586 /////////////////////////////////////////////////////////////////////////////// |
| 583 // PrefService::Preference | 587 // PrefService::Preference |
| 584 | 588 |
| 585 PrefService::Preference::Preference(const PrefService* service, | 589 PrefService::Preference::Preference(const PrefService* service, |
| 586 const char* name) | 590 const char* name) |
| 587 : name_(name), | 591 : name_(name), |
| 588 pref_service_(service) { | 592 pref_service_(service) { |
| 589 DCHECK(name); | 593 DCHECK(name); |
| 590 DCHECK(service); | 594 DCHECK(service); |
| 591 } | 595 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 | 640 |
| 637 bool PrefService::Preference::IsDefaultValue() const { | 641 bool PrefService::Preference::IsDefaultValue() const { |
| 638 return pref_service_->pref_value_store_-> | 642 return pref_service_->pref_value_store_-> |
| 639 PrefValueFromDefaultStore(name_.c_str()); | 643 PrefValueFromDefaultStore(name_.c_str()); |
| 640 } | 644 } |
| 641 | 645 |
| 642 bool PrefService::Preference::IsUserModifiable() const { | 646 bool PrefService::Preference::IsUserModifiable() const { |
| 643 return pref_service_->pref_value_store_-> | 647 return pref_service_->pref_value_store_-> |
| 644 PrefValueUserModifiable(name_.c_str()); | 648 PrefValueUserModifiable(name_.c_str()); |
| 645 } | 649 } |
| OLD | NEW |