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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc

Issue 2782803002: Move tracked prefs into services/preferences/tracked. (Closed)
Patch Set: rebase 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: chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
index 636a8fe753f20a519e78329c5a26cbe3b29a3071..d8713517057675f93f97a66c0df08f961a298fa7 100644
--- a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
@@ -13,8 +13,7 @@
#include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h"
#include "chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident.h"
#include "components/safe_browsing/csd.pb.h"
-#include "components/user_prefs/tracked/pref_hash_store_transaction.h"
-#include "components/user_prefs/tracked/tracked_preference_helper.h"
+#include "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom.h"
namespace safe_browsing {
@@ -24,23 +23,26 @@ typedef ClientIncidentReport_IncidentData_TrackedPreferenceIncident TPIncident;
typedef ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState
TPIncident_ValueState;
+using ValueState =
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState;
+
// Maps a primary PrefHashStoreTransaction::ValueState and an external
// validation state to a TrackedPreferenceIncident::ValueState.
TPIncident_ValueState MapValueState(
- PrefHashStoreTransaction::ValueState value_state,
- PrefHashStoreTransaction::ValueState external_validation_value_state) {
+ ValueState value_state,
+ ValueState external_validation_value_state) {
switch (value_state) {
- case PrefHashStoreTransaction::CLEARED:
+ case ValueState::CLEARED:
return TPIncident::CLEARED;
- case PrefHashStoreTransaction::CHANGED:
+ case ValueState::CHANGED:
return TPIncident::CHANGED;
- case PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE:
+ case ValueState::UNTRUSTED_UNKNOWN_VALUE:
return TPIncident::UNTRUSTED_UNKNOWN_VALUE;
default:
switch (external_validation_value_state) {
- case PrefHashStoreTransaction::CLEARED:
+ case ValueState::CLEARED:
return TPIncident::BYPASS_CLEARED;
- case PrefHashStoreTransaction::CHANGED:
+ case ValueState::CHANGED:
return TPIncident::BYPASS_CHANGED;
default:
return TPIncident::UNKNOWN;
@@ -61,8 +63,8 @@ PreferenceValidationDelegate::~PreferenceValidationDelegate() {
void PreferenceValidationDelegate::OnAtomicPreferenceValidation(
const std::string& pref_path,
std::unique_ptr<base::Value> value,
- PrefHashStoreTransaction::ValueState value_state,
- PrefHashStoreTransaction::ValueState external_validation_value_state,
+ ValueState value_state,
+ ValueState external_validation_value_state,
bool is_personal) {
TPIncident_ValueState proto_value_state =
MapValueState(value_state, external_validation_value_state);
@@ -86,8 +88,8 @@ void PreferenceValidationDelegate::OnSplitPreferenceValidation(
const std::string& pref_path,
const std::vector<std::string>& invalid_keys,
const std::vector<std::string>& external_validation_invalid_keys,
- PrefHashStoreTransaction::ValueState value_state,
- PrefHashStoreTransaction::ValueState external_validation_value_state,
+ ValueState value_state,
+ ValueState external_validation_value_state,
bool is_personal) {
TPIncident_ValueState proto_value_state =
MapValueState(value_state, external_validation_value_state);

Powered by Google App Engine
This is Rietveld 408576698