Home
last modified time | relevance | path

Searched refs:pref_name (Results 1 – 25 of 31) sorted by relevance

12

/external/cronet/components/prefs/
Dpref_notifier_impl_unittest.cc114 const char pref_name[] = "homepage"; in TEST_F() local
118 notifier.AddPrefObserver(pref_name, &obs1_); in TEST_F()
119 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_)); in TEST_F()
121 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_)); in TEST_F()
128 notifier.AddPrefObserver(pref_name, &obs1_); in TEST_F()
129 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_)); in TEST_F()
131 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_)); in TEST_F()
137 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_)); in TEST_F()
139 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_)); in TEST_F()
143 notifier.AddPrefObserver(pref_name, &obs2_); in TEST_F()
[all …]
Dpref_service_unittest.cc38 const char pref_name[] = "homepage"; in TEST() local
39 prefs.registry()->RegisterStringPref(pref_name, std::string()); in TEST()
45 registrar.Add(pref_name, obs.GetCallback()); in TEST()
49 obs.Expect(pref_name, &expected_value); in TEST()
50 prefs.SetString(pref_name, new_pref_value); in TEST()
56 prefs.SetString(pref_name, new_pref_value); in TEST()
61 obs.Expect(pref_name, &expected_default_value); in TEST()
62 prefs.ClearPref(pref_name); in TEST()
67 prefs.ClearPref(pref_name); in TEST()
90 const char pref_name[] = "homepage"; in TEST() local
[all …]
Dpref_member.cc27 void PrefMemberBase::Init(const std::string& pref_name, in Init() argument
31 Init(pref_name, prefs); in Init()
34 void PrefMemberBase::Init(const std::string& pref_name, PrefService* prefs) { in Init() argument
38 pref_name_ = pref_name; in Init()
40 DCHECK(prefs_->FindPreference(pref_name_)) << pref_name << " not registered."; in Init()
43 prefs_->AddPrefObserver(pref_name, this); in Init()
63 const std::string& pref_name) { in OnPreferenceChanged() argument
66 ? base::BindOnce(observer_, pref_name) in OnPreferenceChanged()
90 const std::string& pref_name) { in InvokeUnnamedCallback() argument
151 prefs()->SetBoolean(pref_name(), value); in UpdatePref()
[all …]
Dscoped_user_pref_update_unittest.cc86 std::string pref_name = "mypref"; in TEST_F() local
87 prefs_.registry()->RegisterDictionaryPref(pref_name, std::move(defaults)); in TEST_F()
88 EXPECT_EQ(2u, prefs_.GetDict(pref_name).size()); in TEST_F()
90 ScopedDictPrefUpdate update(&prefs_, pref_name); in TEST_F()
92 EXPECT_EQ(3u, prefs_.GetDict(pref_name).size()); in TEST_F()
134 std::string pref_name = "mypref"; in TEST_F() local
135 prefs_.registry()->RegisterListPref(pref_name, std::move(defaults)); in TEST_F()
136 EXPECT_EQ(2u, prefs_.GetList(pref_name).size()); in TEST_F()
138 ScopedListPrefUpdate update(&prefs_, pref_name); in TEST_F()
140 EXPECT_EQ(3u, prefs_.GetList(pref_name).size()); in TEST_F()
Dpref_member.h102 void Init(const std::string& pref_name,
105 void Init(const std::string& pref_name, PrefService* prefs);
116 const std::string& pref_name) override;
131 const std::string& pref_name() const { return pref_name_; } in pref_name() function
137 const std::string& pref_name);
172 void Init(const std::string& pref_name, in Init() argument
175 subtle::PrefMemberBase::Init(pref_name, prefs, observer); in Init()
177 void Init(const std::string& pref_name, in Init() argument
181 pref_name, prefs, in Init()
184 void Init(const std::string& pref_name, PrefService* prefs) { in Init() argument
[all …]
Dpref_registry.cc23 const std::string& pref_name) const { in GetRegistrationFlags()
24 const auto& it = registration_flags_.find(pref_name); in GetRegistrationFlags()
40 void PrefRegistry::SetDefaultPrefValue(const std::string& pref_name, in SetDefaultPrefValue() argument
43 DCHECK(defaults_->GetValue(pref_name, &current_value)) in SetDefaultPrefValue()
44 << "Setting default for unregistered pref: " << pref_name; in SetDefaultPrefValue()
46 << "Wrong type for new default: " << pref_name; in SetDefaultPrefValue()
48 defaults_->ReplaceDefaultValue(pref_name, std::move(value)); in SetDefaultPrefValue()
Dmock_pref_change_callback.cc20 void MockPrefChangeCallback::Expect(const std::string& pref_name, in Expect() argument
22 EXPECT_CALL(*this, OnPreferenceChanged(pref_name)) in Expect()
23 .With(PrefValueMatches(prefs_.get(), pref_name, value)); in Expect()
Dmock_pref_change_callback.h23 MATCHER_P3(PrefValueMatches, prefs, pref_name, value, "") {
24 const PrefService::Preference* pref = prefs->FindPreference(pref_name);
41 void Expect(const std::string& pref_name,
Dpref_notifier_impl.cc38 const auto& pref_name = observer_list.first; in ~PrefNotifierImpl() local
40 {"Pref observer for ", pref_name, " found at shutdown."}); in ~PrefNotifierImpl()
50 pref_name == "bookmark_bar.show_on_all_tabs" || in ~PrefNotifierImpl()
52 pref_name == "profile.icon_version") { in ~PrefNotifierImpl()
Dpref_service.cc246 const std::string& pref_name) const { in FindPreference()
248 auto it = prefs_map_.find(pref_name); in FindPreference()
252 if (!pref_registry_->defaults()->GetValue(pref_name, &default_value)) in FindPreference()
256 pref_name, Preference(this, pref_name, default_value->type()))) in FindPreference()
288 bool PrefService::IsManagedPreference(const std::string& pref_name) const { in IsManagedPreference()
289 const Preference* pref = FindPreference(pref_name); in IsManagedPreference()
294 const std::string& pref_name) const { in IsPreferenceManagedByCustodian()
295 const Preference* pref = FindPreference(pref_name); in IsPreferenceManagedByCustodian()
300 const std::string& pref_name) const { in IsUserModifiablePreference()
301 const Preference* pref = FindPreference(pref_name); in IsUserModifiablePreference()
Dpref_change_registrar.h69 const std::string& pref_name) override;
72 const std::string& pref_name);
Dpref_registry.h64 uint32_t GetRegistrationFlags(const std::string& pref_name) const;
76 void SetDefaultPrefValue(const std::string& pref_name, base::Value value);
Dpref_member_unittest.cc43 void Init(const std::string& pref_name, PrefService* prefs) { in Init() argument
44 pref_.Init(pref_name, prefs); in Init()
88 void OnPreferenceChanged(const std::string& pref_name) { in OnPreferenceChanged() argument
89 EXPECT_EQ(pref_name, kStringPref); in OnPreferenceChanged()
Dpref_service.h223 bool IsManagedPreference(const std::string& pref_name) const;
227 bool IsPreferenceManagedByCustodian(const std::string& pref_name) const;
231 bool IsUserModifiablePreference(const std::string& pref_name) const;
Dpref_observer.h18 const std::string& pref_name) = 0;
Dpref_notifier.h20 virtual void OnPreferenceChanged(const std::string& pref_name) = 0;
/external/cronet/components/metrics/
Ddate_changed_helper.cc22 const char* pref_name, in UpdateStoredDate() argument
24 prefs->SetTime(pref_name, GetCurrentDate(now)); in UpdateStoredDate()
28 const char* pref_name, in IsStoredDateToday() argument
30 base::Time stored_date = prefs->GetTime(pref_name); in IsStoredDateToday()
33 UpdateStoredDate(prefs, pref_name, GetCurrentDate(now)); in IsStoredDateToday()
44 bool HasDateChangedSinceLastCall(PrefService* prefs, const char* pref_name) { in HasDateChangedSinceLastCall() argument
46 DCHECK(pref_name); in HasDateChangedSinceLastCall()
48 if (IsStoredDateToday(prefs, pref_name, now)) in HasDateChangedSinceLastCall()
50 UpdateStoredDate(prefs, pref_name, now); in HasDateChangedSinceLastCall()
54 void RegisterPref(PrefRegistrySimple* registry, const char* pref_name) { in RegisterPref() argument
[all …]
Ddata_use_tracker.cc101 void DataUseTracker::UpdateUsagePref(const std::string& pref_name, in UpdateUsagePref() argument
105 ScopedDictPrefUpdate pref_updater(local_state_, pref_name); in UpdateUsagePref()
108 const base::Value::Dict& user_pref_dict = local_state_->GetDict(pref_name); in UpdateUsagePref()
119 void DataUseTracker::RemoveExpiredEntriesForPref(const std::string& pref_name) { in RemoveExpiredEntriesForPref() argument
122 const base::Value::Dict& user_pref_dict = local_state_->GetDict(pref_name); in RemoveExpiredEntriesForPref()
134 local_state_->SetDict(pref_name, std::move(user_pref_new_dict)); in RemoveExpiredEntriesForPref()
141 int DataUseTracker::ComputeTotalDataUse(const std::string& pref_name) { in ComputeTotalDataUse() argument
145 const base::Value::Dict& pref_dict = local_state_->GetDict(pref_name); in ComputeTotalDataUse()
Ddaily_event.cc34 const char* pref_name, in DailyEvent() argument
37 pref_name_(pref_name), in DailyEvent()
46 const std::string& pref_name) { in RegisterPref() argument
47 registry->RegisterInt64Pref(pref_name, 0); in RegisterPref()
Ddata_use_tracker.h62 void UpdateUsagePref(const std::string& pref_name, int message_size);
69 void RemoveExpiredEntriesForPref(const std::string& pref_name);
73 int ComputeTotalDataUse(const std::string& pref_name);
Ddate_changed_helper.h20 const char* pref_name);
23 void RegisterPref(PrefRegistrySimple* registry, const char* pref_name);
Ddaily_event.h63 const char* pref_name,
81 const std::string& pref_name);
/external/cronet/components/prefs/ios/
Dpref_observer_bridge.mm20 const std::string& pref_name,
24 registrar->Add(pref_name.c_str(), callback);
27 void PrefObserverBridge::OnPreferenceChanged(const std::string& pref_name) {
28 [delegate_ onPreferenceChanged:pref_name];
Dpref_observer_bridge.h23 virtual void ObserveChangesForPreference(const std::string& pref_name,
27 virtual void OnPreferenceChanged(const std::string& pref_name);
/external/cronet/components/cronet/
Dhost_cache_persistence_manager.cc19 std::string pref_name, in HostCachePersistenceManager() argument
24 pref_name_(pref_name), in HostCachePersistenceManager()

12