OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/prefs/json_pref_store.h" | 5 #include "base/prefs/json_pref_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 public: | 33 public: |
34 InterceptingPrefFilter(); | 34 InterceptingPrefFilter(); |
35 virtual ~InterceptingPrefFilter(); | 35 virtual ~InterceptingPrefFilter(); |
36 | 36 |
37 // PrefFilter implementation: | 37 // PrefFilter implementation: |
38 virtual void FilterOnLoad( | 38 virtual void FilterOnLoad( |
39 const PostFilterOnLoadCallback& post_filter_on_load_callback, | 39 const PostFilterOnLoadCallback& post_filter_on_load_callback, |
40 scoped_ptr<base::DictionaryValue> pref_store_contents) OVERRIDE; | 40 scoped_ptr<base::DictionaryValue> pref_store_contents) OVERRIDE; |
41 virtual void FilterUpdate(const std::string& path) OVERRIDE {} | 41 virtual void FilterUpdate(const std::string& path) OVERRIDE {} |
42 virtual void FilterSerializeData( | 42 virtual void FilterSerializeData( |
43 const base::DictionaryValue* pref_store_contents) OVERRIDE {} | 43 base::DictionaryValue* pref_store_contents) OVERRIDE {} |
44 | 44 |
45 bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; } | 45 bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; } |
46 | 46 |
47 // Finalize an intercepted read, handing |intercept_prefs_| back to its | 47 // Finalize an intercepted read, handing |intercept_prefs_| back to its |
48 // JsonPrefStore. | 48 // JsonPrefStore. |
49 void ReleasePrefs(); | 49 void ReleasePrefs(); |
50 | 50 |
51 private: | 51 private: |
52 PostFilterOnLoadCallback post_filter_on_load_callback_; | 52 PostFilterOnLoadCallback post_filter_on_load_callback_; |
53 scoped_ptr<base::DictionaryValue> intercepted_prefs_; | 53 scoped_ptr<base::DictionaryValue> intercepted_prefs_; |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 // "new_windows_in_tabs": true, | 463 // "new_windows_in_tabs": true, |
464 // "max_tabs": 20 | 464 // "max_tabs": 20 |
465 // } | 465 // } |
466 // } | 466 // } |
467 | 467 |
468 RunBasicJsonPrefStoreTest( | 468 RunBasicJsonPrefStoreTest( |
469 pref_store.get(), input_file, data_dir_.AppendASCII("write.golden.json")); | 469 pref_store.get(), input_file, data_dir_.AppendASCII("write.golden.json")); |
470 } | 470 } |
471 | 471 |
472 } // namespace base | 472 } // namespace base |
OLD | NEW |