| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 Value* found_value = NULL; | 595 Value* found_value = NULL; |
| 596 if (pref_service_->pref_value_store_->GetValue(name_, &found_value)) | 596 if (pref_service_->pref_value_store_->GetValue(name_, &found_value)) |
| 597 return found_value; | 597 return found_value; |
| 598 | 598 |
| 599 // Every registered preference has at least a default value. | 599 // Every registered preference has at least a default value. |
| 600 NOTREACHED() << "no valid value found for registered pref " << name_; | 600 NOTREACHED() << "no valid value found for registered pref " << name_; |
| 601 return NULL; | 601 return NULL; |
| 602 } | 602 } |
| 603 | 603 |
| 604 bool PrefService::Preference::IsManaged() const { | 604 bool PrefService::Preference::IsManaged() const { |
| 605 return pref_service_->pref_value_store_-> | 605 PrefValueStore* pref_value_store = |
| 606 PrefValueInManagedStore(name_.c_str()); | 606 pref_service_->pref_value_store_; |
| 607 return pref_value_store->PrefValueInManagedPlatformStore(name_.c_str()) || |
| 608 pref_value_store->PrefValueInDeviceManagementStore(name_.c_str()); |
| 607 } | 609 } |
| 608 | 610 |
| 609 bool PrefService::Preference::HasExtensionSetting() const { | 611 bool PrefService::Preference::HasExtensionSetting() const { |
| 610 return pref_service_->pref_value_store_-> | 612 return pref_service_->pref_value_store_-> |
| 611 PrefValueInExtensionStore(name_.c_str()); | 613 PrefValueInExtensionStore(name_.c_str()); |
| 612 } | 614 } |
| 613 | 615 |
| 614 bool PrefService::Preference::HasUserSetting() const { | 616 bool PrefService::Preference::HasUserSetting() const { |
| 615 return pref_service_->pref_value_store_-> | 617 return pref_service_->pref_value_store_-> |
| 616 PrefValueInUserStore(name_.c_str()); | 618 PrefValueInUserStore(name_.c_str()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 628 | 630 |
| 629 bool PrefService::Preference::IsDefaultValue() const { | 631 bool PrefService::Preference::IsDefaultValue() const { |
| 630 return pref_service_->pref_value_store_-> | 632 return pref_service_->pref_value_store_-> |
| 631 PrefValueFromDefaultStore(name_.c_str()); | 633 PrefValueFromDefaultStore(name_.c_str()); |
| 632 } | 634 } |
| 633 | 635 |
| 634 bool PrefService::Preference::IsUserModifiable() const { | 636 bool PrefService::Preference::IsUserModifiable() const { |
| 635 return pref_service_->pref_value_store_-> | 637 return pref_service_->pref_value_store_-> |
| 636 PrefValueUserModifiable(name_.c_str()); | 638 PrefValueUserModifiable(name_.c_str()); |
| 637 } | 639 } |
| OLD | NEW |