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 #include "chrome/browser/prefs/tracked/mock_validation_delegate.h" | 5 #include "components/user_prefs/tracked/mock_validation_delegate.h" |
6 | 6 |
7 MockValidationDelegate::MockValidationDelegate() { | 7 MockValidationDelegate::MockValidationDelegate() { |
8 } | 8 } |
9 | 9 |
10 MockValidationDelegate::~MockValidationDelegate() { | 10 MockValidationDelegate::~MockValidationDelegate() { |
11 } | 11 } |
12 | 12 |
13 size_t MockValidationDelegate::CountValidationsOfState( | 13 size_t MockValidationDelegate::CountValidationsOfState( |
14 PrefHashStoreTransaction::ValueState value_state) const { | 14 PrefHashStoreTransaction::ValueState value_state) const { |
15 size_t count = 0; | 15 size_t count = 0; |
(...skipping 11 matching lines...) Expand all Loading... |
27 return &validations_[i]; | 27 return &validations_[i]; |
28 } | 28 } |
29 return NULL; | 29 return NULL; |
30 } | 30 } |
31 | 31 |
32 void MockValidationDelegate::OnAtomicPreferenceValidation( | 32 void MockValidationDelegate::OnAtomicPreferenceValidation( |
33 const std::string& pref_path, | 33 const std::string& pref_path, |
34 const base::Value* value, | 34 const base::Value* value, |
35 PrefHashStoreTransaction::ValueState value_state, | 35 PrefHashStoreTransaction::ValueState value_state, |
36 bool is_personal) { | 36 bool is_personal) { |
37 RecordValidation(pref_path, | 37 RecordValidation(pref_path, value_state, is_personal, |
38 value_state, | |
39 is_personal, | |
40 PrefHashFilter::TRACKING_STRATEGY_ATOMIC); | 38 PrefHashFilter::TRACKING_STRATEGY_ATOMIC); |
41 } | 39 } |
42 | 40 |
43 void MockValidationDelegate::OnSplitPreferenceValidation( | 41 void MockValidationDelegate::OnSplitPreferenceValidation( |
44 const std::string& pref_path, | 42 const std::string& pref_path, |
45 const base::DictionaryValue* dict_value, | 43 const base::DictionaryValue* dict_value, |
46 const std::vector<std::string>& invalid_keys, | 44 const std::vector<std::string>& invalid_keys, |
47 PrefHashStoreTransaction::ValueState value_state, | 45 PrefHashStoreTransaction::ValueState value_state, |
48 bool is_personal) { | 46 bool is_personal) { |
49 RecordValidation(pref_path, | 47 RecordValidation(pref_path, value_state, is_personal, |
50 value_state, | |
51 is_personal, | |
52 PrefHashFilter::TRACKING_STRATEGY_SPLIT); | 48 PrefHashFilter::TRACKING_STRATEGY_SPLIT); |
53 } | 49 } |
54 | 50 |
55 void MockValidationDelegate::RecordValidation( | 51 void MockValidationDelegate::RecordValidation( |
56 const std::string& pref_path, | 52 const std::string& pref_path, |
57 PrefHashStoreTransaction::ValueState value_state, | 53 PrefHashStoreTransaction::ValueState value_state, |
58 bool is_personal, | 54 bool is_personal, |
59 PrefHashFilter::PrefTrackingStrategy strategy) { | 55 PrefHashFilter::PrefTrackingStrategy strategy) { |
60 validations_.push_back( | 56 validations_.push_back( |
61 ValidationEvent(pref_path, value_state, is_personal, strategy)); | 57 ValidationEvent(pref_path, value_state, is_personal, strategy)); |
62 } | 58 } |
OLD | NEW |