| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DE
LEGATE_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DE
LEGATE_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DE
LEGATE_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DE
LEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/user_prefs/tracked/tracked_preference_validation_delegate.h
" | 12 #include "services/preferences/public/interfaces/tracked_preference_validation_d
elegate.mojom.h" |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace safe_browsing { | 16 namespace safe_browsing { |
| 17 | 17 |
| 18 class IncidentReceiver; | 18 class IncidentReceiver; |
| 19 | 19 |
| 20 // A preference validation delegate that adds incidents to a given receiver | 20 // A preference validation delegate that adds incidents to a given receiver |
| 21 // for preference validation failures. The profile for which the delegate | 21 // for preference validation failures. The profile for which the delegate |
| 22 // operates must outlive the delegate itself. | 22 // operates must outlive the delegate itself. |
| 23 class PreferenceValidationDelegate | 23 class PreferenceValidationDelegate |
| 24 : public TrackedPreferenceValidationDelegate { | 24 : public prefs::mojom::TrackedPreferenceValidationDelegate { |
| 25 public: | 25 public: |
| 26 PreferenceValidationDelegate( | 26 PreferenceValidationDelegate( |
| 27 Profile* profile, | 27 Profile* profile, |
| 28 std::unique_ptr<IncidentReceiver> incident_receiver); | 28 std::unique_ptr<IncidentReceiver> incident_receiver); |
| 29 ~PreferenceValidationDelegate() override; | 29 ~PreferenceValidationDelegate() override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 // TrackedPreferenceValidationDelegate methods. | 32 // TrackedPreferenceValidationDelegate methods. |
| 33 void OnAtomicPreferenceValidation( | 33 void OnAtomicPreferenceValidation( |
| 34 const std::string& pref_path, | 34 const std::string& pref_path, |
| 35 const base::Value* value, | 35 std::unique_ptr<base::Value> value, |
| 36 PrefHashStoreTransaction::ValueState value_state, | 36 PrefHashStoreTransaction::ValueState value_state, |
| 37 PrefHashStoreTransaction::ValueState external_validation_value_state, | 37 PrefHashStoreTransaction::ValueState external_validation_value_state, |
| 38 bool is_personal) override; | 38 bool is_personal) override; |
| 39 void OnSplitPreferenceValidation( | 39 void OnSplitPreferenceValidation( |
| 40 const std::string& pref_path, | 40 const std::string& pref_path, |
| 41 const base::DictionaryValue* dict_value, | |
| 42 const std::vector<std::string>& invalid_keys, | 41 const std::vector<std::string>& invalid_keys, |
| 43 const std::vector<std::string>& external_validation_invalid_keys, | 42 const std::vector<std::string>& external_validation_invalid_keys, |
| 44 PrefHashStoreTransaction::ValueState value_state, | 43 PrefHashStoreTransaction::ValueState value_state, |
| 45 PrefHashStoreTransaction::ValueState external_validation_value_state, | 44 PrefHashStoreTransaction::ValueState external_validation_value_state, |
| 46 bool is_personal) override; | 45 bool is_personal) override; |
| 47 | 46 |
| 48 Profile* profile_; | 47 Profile* profile_; |
| 49 std::unique_ptr<IncidentReceiver> incident_receiver_; | 48 std::unique_ptr<IncidentReceiver> incident_receiver_; |
| 50 | 49 |
| 51 DISALLOW_COPY_AND_ASSIGN(PreferenceValidationDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(PreferenceValidationDelegate); |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 } // namespace safe_browsing | 53 } // namespace safe_browsing |
| 55 | 54 |
| 56 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION
_DELEGATE_H_ | 55 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION
_DELEGATE_H_ |
| OLD | NEW |