Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/browser/extensions/test_extension_prefs.h

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review1 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "extensions/common/manifest.h" 13 #include "extensions/common/manifest.h"
14 14
15 class ExtensionPrefValueMap; 15 class ExtensionPrefValueMap;
16 class PrefService; 16 class PrefService;
17 class PrefServiceSyncable; 17 class PrefServiceSyncable;
18 18
19 namespace base { 19 namespace base {
20 class DictionaryValue; 20 class DictionaryValue;
21 class SequencedTaskRunner; 21 class SequencedTaskRunner;
22 } 22 }
23 23
24 namespace user_prefs { 24 namespace user_prefs {
25 class PrefRegistrySyncable; 25 class PrefRegistrySyncable;
26 } 26 }
27 27
28 namespace extensions { 28 namespace extensions {
29 class ChromeAppSorting;
29 class Extension; 30 class Extension;
30 class ExtensionPrefs; 31 class ExtensionPrefs;
31 32
32 // This is a test class intended to make it easier to work with ExtensionPrefs 33 // This is a test class intended to make it easier to work with ExtensionPrefs
33 // in tests. 34 // in tests.
34 class TestExtensionPrefs { 35 class TestExtensionPrefs {
35 public: 36 public:
36 explicit TestExtensionPrefs( 37 explicit TestExtensionPrefs(
37 const scoped_refptr<base::SequencedTaskRunner>& task_runner); 38 const scoped_refptr<base::SequencedTaskRunner>& task_runner);
38 virtual ~TestExtensionPrefs(); 39 virtual ~TestExtensionPrefs();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 // This will add extension in our ExtensionPrefs. 82 // This will add extension in our ExtensionPrefs.
82 void AddExtension(Extension* extension); 83 void AddExtension(Extension* extension);
83 84
84 PrefService* CreateIncognitoPrefService() const; 85 PrefService* CreateIncognitoPrefService() const;
85 86
86 // Allows disabling the loading of preferences of extensions. Becomes 87 // Allows disabling the loading of preferences of extensions. Becomes
87 // active after calling RecreateExtensionPrefs(). Defaults to false. 88 // active after calling RecreateExtensionPrefs(). Defaults to false.
88 void set_extensions_disabled(bool extensions_disabled); 89 void set_extensions_disabled(bool extensions_disabled);
89 90
91 ChromeAppSorting* app_sorting() { return app_sorting_.get(); }
92
90 protected: 93 protected:
91 base::ScopedTempDir temp_dir_; 94 base::ScopedTempDir temp_dir_;
92 base::FilePath preferences_file_; 95 base::FilePath preferences_file_;
93 base::FilePath extensions_dir_; 96 base::FilePath extensions_dir_;
94 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry_; 97 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry_;
95 scoped_ptr<PrefServiceSyncable> pref_service_; 98 scoped_ptr<PrefServiceSyncable> pref_service_;
96 scoped_ptr<ExtensionPrefs> prefs_; 99 scoped_ptr<ExtensionPrefs> prefs_;
97 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; 100 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
101 scoped_ptr<ChromeAppSorting> app_sorting_;
98 const scoped_refptr<base::SequencedTaskRunner> task_runner_; 102 const scoped_refptr<base::SequencedTaskRunner> task_runner_;
99 103
100 private: 104 private:
101 bool extensions_disabled_; 105 bool extensions_disabled_;
102 DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs); 106 DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs);
103 }; 107 };
104 108
105 } // namespace extensions 109 } // namespace extensions
106 110
107 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ 111 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698