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 "components/prefs/pref_service.h" | 5 #include "components/prefs/pref_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 554 |
555 // The pref has no recommended value. | 555 // The pref has no recommended value. |
556 return NULL; | 556 return NULL; |
557 } | 557 } |
558 | 558 |
559 bool PrefService::Preference::IsManaged() const { | 559 bool PrefService::Preference::IsManaged() const { |
560 return pref_value_store()->PrefValueInManagedStore(name_); | 560 return pref_value_store()->PrefValueInManagedStore(name_); |
561 } | 561 } |
562 | 562 |
563 bool PrefService::Preference::IsManagedByCustodian() const { | 563 bool PrefService::Preference::IsManagedByCustodian() const { |
564 return pref_value_store()->PrefValueInSupervisedStore(name_.c_str()); | 564 return pref_value_store()->PrefValueInSupervisedStore(name_); |
565 } | 565 } |
566 | 566 |
567 bool PrefService::Preference::IsRecommended() const { | 567 bool PrefService::Preference::IsRecommended() const { |
568 return pref_value_store()->PrefValueFromRecommendedStore(name_); | 568 return pref_value_store()->PrefValueFromRecommendedStore(name_); |
569 } | 569 } |
570 | 570 |
571 bool PrefService::Preference::HasExtensionSetting() const { | 571 bool PrefService::Preference::HasExtensionSetting() const { |
572 return pref_value_store()->PrefValueInExtensionStore(name_); | 572 return pref_value_store()->PrefValueInExtensionStore(name_); |
573 } | 573 } |
574 | 574 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 DCHECK(found_value->IsType(default_type)); | 615 DCHECK(found_value->IsType(default_type)); |
616 return found_value; | 616 return found_value; |
617 } else { | 617 } else { |
618 // Every registered preference has at least a default value. | 618 // Every registered preference has at least a default value. |
619 NOTREACHED() << "no valid value found for registered pref " << path; | 619 NOTREACHED() << "no valid value found for registered pref " << path; |
620 } | 620 } |
621 } | 621 } |
622 | 622 |
623 return NULL; | 623 return NULL; |
624 } | 624 } |
OLD | NEW |