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/tracked_atomic_preference.h" | 5 #include "chrome/browser/prefs/tracked/tracked_atomic_preference.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/prefs/pref_hash_store_transaction.h" | 8 #include "chrome/browser/prefs/tracked/pref_hash_store_transaction.h" |
9 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 9 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
10 | 10 |
11 TrackedAtomicPreference::TrackedAtomicPreference( | 11 TrackedAtomicPreference::TrackedAtomicPreference( |
12 const std::string& pref_path, | 12 const std::string& pref_path, |
13 size_t reporting_id, | 13 size_t reporting_id, |
14 size_t reporting_ids_count, | 14 size_t reporting_ids_count, |
15 PrefHashFilter::EnforcementLevel enforcement_level, | 15 PrefHashFilter::EnforcementLevel enforcement_level, |
16 TrackedPreferenceValidationDelegate* delegate) | 16 TrackedPreferenceValidationDelegate* delegate) |
17 : pref_path_(pref_path), | 17 : pref_path_(pref_path), |
18 helper_(pref_path, reporting_id, reporting_ids_count, enforcement_level), | 18 helper_(pref_path, reporting_id, reporting_ids_count, enforcement_level), |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 if (value_state != PrefHashStoreTransaction::UNCHANGED) { | 52 if (value_state != PrefHashStoreTransaction::UNCHANGED) { |
53 // Store the hash for the new value (whether it was reset or not). | 53 // Store the hash for the new value (whether it was reset or not). |
54 const base::Value* new_value = NULL; | 54 const base::Value* new_value = NULL; |
55 pref_store_contents->Get(pref_path_, &new_value); | 55 pref_store_contents->Get(pref_path_, &new_value); |
56 transaction->StoreHash(pref_path_, new_value); | 56 transaction->StoreHash(pref_path_, new_value); |
57 } | 57 } |
58 | 58 |
59 return was_reset; | 59 return was_reset; |
60 } | 60 } |
OLD | NEW |