Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(728)

Unified Diff: components/user_prefs/tracked/tracked_atomic_preference.cc

Issue 2719833002: Convert TrackedPreferenceValidationDelegate into a mojo interface. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/user_prefs/tracked/tracked_atomic_preference.cc
diff --git a/components/user_prefs/tracked/tracked_atomic_preference.cc b/components/user_prefs/tracked/tracked_atomic_preference.cc
index e2b76784b81a7be1685d390f92c06d2be5dbe4c8..1eb86f6a03c9adab26e81ea748c1994fc6f28dc4 100644
--- a/components/user_prefs/tracked/tracked_atomic_preference.cc
+++ b/components/user_prefs/tracked/tracked_atomic_preference.cc
@@ -6,7 +6,7 @@
#include "base/values.h"
#include "components/user_prefs/tracked/pref_hash_store_transaction.h"
-#include "components/user_prefs/tracked/tracked_preference_validation_delegate.h"
+#include "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom.h"
TrackedAtomicPreference::TrackedAtomicPreference(
const std::string& pref_path,
@@ -14,15 +14,14 @@ TrackedAtomicPreference::TrackedAtomicPreference(
size_t reporting_ids_count,
PrefHashFilter::EnforcementLevel enforcement_level,
PrefHashFilter::ValueType value_type,
- TrackedPreferenceValidationDelegate* delegate)
+ prefs::mojom::TrackedPreferenceValidationDelegate* delegate)
: pref_path_(pref_path),
helper_(pref_path,
reporting_id,
reporting_ids_count,
enforcement_level,
value_type),
- delegate_(delegate) {
-}
+ delegate_(delegate) {}
TrackedPreferenceType TrackedAtomicPreference::GetType() const {
return TrackedPreferenceType::ATOMIC;
@@ -55,9 +54,9 @@ bool TrackedAtomicPreference::EnforceAndReport(
}
if (delegate_) {
- delegate_->OnAtomicPreferenceValidation(pref_path_, value, value_state,
- external_validation_value_state,
- helper_.IsPersonal());
+ delegate_->OnAtomicPreferenceValidation(
+ pref_path_, value ? value->CreateDeepCopy() : nullptr, value_state,
+ external_validation_value_state, helper_.IsPersonal());
}
TrackedPreferenceHelper::ResetAction reset_action =
helper_.GetAction(value_state);

Powered by Google App Engine
This is Rietveld 408576698