| 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 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace extensions { | 28 namespace extensions { |
| 29 class Extension; | 29 class Extension; |
| 30 class ExtensionPrefs; | 30 class ExtensionPrefs; |
| 31 | 31 |
| 32 // This is a test class intended to make it easier to work with ExtensionPrefs | 32 // This is a test class intended to make it easier to work with ExtensionPrefs |
| 33 // in tests. | 33 // in tests. |
| 34 class TestExtensionPrefs { | 34 class TestExtensionPrefs { |
| 35 public: | 35 public: |
| 36 explicit TestExtensionPrefs(base::SequencedTaskRunner* task_runner); | 36 explicit TestExtensionPrefs( |
| 37 const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
| 37 virtual ~TestExtensionPrefs(); | 38 virtual ~TestExtensionPrefs(); |
| 38 | 39 |
| 39 ExtensionPrefs* prefs() { return prefs_.get(); } | 40 ExtensionPrefs* prefs() { return prefs_.get(); } |
| 40 const ExtensionPrefs& const_prefs() const { | 41 const ExtensionPrefs& const_prefs() const { |
| 41 return *prefs_.get(); | 42 return *prefs_.get(); |
| 42 } | 43 } |
| 43 PrefService* pref_service(); | 44 PrefService* pref_service(); |
| 44 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry(); | 45 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry(); |
| 45 void ResetPrefRegistry(); | 46 void ResetPrefRegistry(); |
| 46 const base::FilePath& temp_dir() const { return temp_dir_.path(); } | 47 const base::FilePath& temp_dir() const { return temp_dir_.path(); } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 const scoped_refptr<base::SequencedTaskRunner> task_runner_; | 95 const scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 95 | 96 |
| 96 private: | 97 private: |
| 97 bool extensions_disabled_; | 98 bool extensions_disabled_; |
| 98 DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs); | 99 DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs); |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 } // namespace extensions | 102 } // namespace extensions |
| 102 | 103 |
| 103 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ | 104 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ |
| OLD | NEW |