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