| 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_PREFS_TRACKED_MOCK_VALIDATION_DELEGATE_H_ | 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_MOCK_VALIDATION_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_PREFS_TRACKED_MOCK_VALIDATION_DELEGATE_H_ | 6 #define COMPONENTS_USER_PREFS_TRACKED_MOCK_VALIDATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "chrome/browser/prefs/tracked/pref_hash_filter.h" | 13 #include "components/user_prefs/tracked/pref_hash_filter.h" |
| 14 #include "chrome/browser/prefs/tracked/pref_hash_store_transaction.h" | 14 #include "components/user_prefs/tracked/pref_hash_store_transaction.h" |
| 15 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 15 #include "components/user_prefs/tracked/tracked_preference_validation_delegate.h
" |
| 16 | 16 |
| 17 // A mock tracked preference validation delegate for use by tests. | 17 // A mock tracked preference validation delegate for use by tests. |
| 18 class MockValidationDelegate : public TrackedPreferenceValidationDelegate { | 18 class MockValidationDelegate : public TrackedPreferenceValidationDelegate { |
| 19 public: | 19 public: |
| 20 struct ValidationEvent { | 20 struct ValidationEvent { |
| 21 ValidationEvent(const std::string& path, | 21 ValidationEvent(const std::string& path, |
| 22 PrefHashStoreTransaction::ValueState state, | 22 PrefHashStoreTransaction::ValueState state, |
| 23 bool is_personal, | 23 bool is_personal, |
| 24 PrefHashFilter::PrefTrackingStrategy tracking_strategy) | 24 PrefHashFilter::PrefTrackingStrategy tracking_strategy) |
| 25 : pref_path(path), | 25 : pref_path(path), |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void RecordValidation(const std::string& pref_path, | 64 void RecordValidation(const std::string& pref_path, |
| 65 PrefHashStoreTransaction::ValueState value_state, | 65 PrefHashStoreTransaction::ValueState value_state, |
| 66 bool is_personal, | 66 bool is_personal, |
| 67 PrefHashFilter::PrefTrackingStrategy strategy); | 67 PrefHashFilter::PrefTrackingStrategy strategy); |
| 68 | 68 |
| 69 std::vector<ValidationEvent> validations_; | 69 std::vector<ValidationEvent> validations_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(MockValidationDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(MockValidationDelegate); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 #endif // CHROME_BROWSER_PREFS_TRACKED_MOCK_VALIDATION_DELEGATE_H_ | 74 #endif // COMPONENTS_USER_PREFS_TRACKED_MOCK_VALIDATION_DELEGATE_H_ |
| OLD | NEW |