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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DELEGATE_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DELEGATE_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "components/user_prefs/tracked/tracked_preference_validation_delegate.h"
15 namespace safe_browsing
{
17 class IncidentReceiver
;
19 // A preference validation delegate that adds incidents to a given receiver
20 // for preference validation failures. The profile for which the delegate
21 // operates must outlive the delegate itself.
22 class PreferenceValidationDelegate
23 : public TrackedPreferenceValidationDelegate
{
25 PreferenceValidationDelegate(Profile
* profile
,
26 scoped_ptr
<IncidentReceiver
> incident_receiver
);
27 ~PreferenceValidationDelegate() override
;
30 // TrackedPreferenceValidationDelegate methods.
31 void OnAtomicPreferenceValidation(
32 const std::string
& pref_path
,
33 const base::Value
* value
,
34 PrefHashStoreTransaction::ValueState value_state
,
35 bool is_personal
) override
;
36 void OnSplitPreferenceValidation(
37 const std::string
& pref_path
,
38 const base::DictionaryValue
* dict_value
,
39 const std::vector
<std::string
>& invalid_keys
,
40 PrefHashStoreTransaction::ValueState value_state
,
41 bool is_personal
) override
;
44 scoped_ptr
<IncidentReceiver
> incident_receiver_
;
46 DISALLOW_COPY_AND_ASSIGN(PreferenceValidationDelegate
);
49 } // namespace safe_browsing
51 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PREFERENCE_VALIDATION_DELEGATE_H_