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

Side by Side Diff: extensions/shell/browser/shell_extension_system.h

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix extensions_unittests 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 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 EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "extensions/browser/extension_system.h" 12 #include "extensions/browser/extension_system.h"
13 #include "extensions/common/one_shot_event.h" 13 #include "extensions/common/one_shot_event.h"
14 14
15 class BrowserContextKeyedServiceFactory; 15 class BrowserContextKeyedServiceFactory;
16 16
17 namespace base { 17 namespace base {
18 class FilePath; 18 class FilePath;
19 } 19 }
20 20
21 namespace content { 21 namespace content {
22 class BrowserContext; 22 class BrowserContext;
23 } 23 }
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 class InfoMap; 27 class InfoMap;
28 class ProcessManager; 28 class ProcessManager;
29 class RendererStartupHelper; 29 class RendererStartupHelper;
30 class SharedUserScriptMaster; 30 class SharedUserScriptMaster;
not at google - send to devlin 2015/08/03 21:12:08 Cleanup: RendererStartupHelper and ProcessManager
Marc Treib 2015/08/04 08:36:29 Done.
31 31
32 // A simplified version of ExtensionSystem for app_shell. Allows 32 // A simplified version of ExtensionSystem for app_shell. Allows
33 // app_shell to skip initialization of services it doesn't need. 33 // app_shell to skip initialization of services it doesn't need.
34 class ShellExtensionSystem : public ExtensionSystem { 34 class ShellExtensionSystem : public ExtensionSystem {
35 public: 35 public:
36 explicit ShellExtensionSystem(content::BrowserContext* browser_context); 36 explicit ShellExtensionSystem(content::BrowserContext* browser_context);
37 ~ShellExtensionSystem() override; 37 ~ShellExtensionSystem() override;
38 38
39 // Loads an unpacked application from a directory. Returns the extension on 39 // Loads an unpacked application from a directory. Returns the extension on
40 // success, or null otherwise. 40 // success, or null otherwise.
(...skipping 11 matching lines...) Expand all
52 // ExtensionSystem implementation: 52 // ExtensionSystem implementation:
53 void InitForRegularProfile(bool extensions_enabled) override; 53 void InitForRegularProfile(bool extensions_enabled) override;
54 ExtensionService* extension_service() override; 54 ExtensionService* extension_service() override;
55 RuntimeData* runtime_data() override; 55 RuntimeData* runtime_data() override;
56 ManagementPolicy* management_policy() override; 56 ManagementPolicy* management_policy() override;
57 SharedUserScriptMaster* shared_user_script_master() override; 57 SharedUserScriptMaster* shared_user_script_master() override;
58 StateStore* state_store() override; 58 StateStore* state_store() override;
59 StateStore* rules_store() override; 59 StateStore* rules_store() override;
60 InfoMap* info_map() override; 60 InfoMap* info_map() override;
61 QuotaService* quota_service() override; 61 QuotaService* quota_service() override;
62 AppSorting* app_sorting() override;
62 void RegisterExtensionWithRequestContexts( 63 void RegisterExtensionWithRequestContexts(
63 const Extension* extension, 64 const Extension* extension,
64 const base::Closure& callback) override; 65 const base::Closure& callback) override;
65 void UnregisterExtensionWithRequestContexts( 66 void UnregisterExtensionWithRequestContexts(
66 const std::string& extension_id, 67 const std::string& extension_id,
67 const UnloadedExtensionInfo::Reason reason) override; 68 const UnloadedExtensionInfo::Reason reason) override;
68 const OneShotEvent& ready() const override; 69 const OneShotEvent& ready() const override;
69 ContentVerifier* content_verifier() override; 70 ContentVerifier* content_verifier() override;
70 scoped_ptr<ExtensionSet> GetDependentExtensions( 71 scoped_ptr<ExtensionSet> GetDependentExtensions(
71 const Extension* extension) override; 72 const Extension* extension) override;
72 73
73 private: 74 private:
74 void OnExtensionRegisteredWithRequestContexts( 75 void OnExtensionRegisteredWithRequestContexts(
75 scoped_refptr<Extension> extension); 76 scoped_refptr<Extension> extension);
76 content::BrowserContext* browser_context_; // Not owned. 77 content::BrowserContext* browser_context_; // Not owned.
77 78
78 // Data to be accessed on the IO thread. Must outlive process_manager_. 79 // Data to be accessed on the IO thread. Must outlive process_manager_.
79 scoped_refptr<InfoMap> info_map_; 80 scoped_refptr<InfoMap> info_map_;
80 81
81 scoped_ptr<RuntimeData> runtime_data_; 82 scoped_ptr<RuntimeData> runtime_data_;
82 scoped_ptr<QuotaService> quota_service_; 83 scoped_ptr<QuotaService> quota_service_;
84 scoped_ptr<AppSorting> app_sorting_;
83 85
84 // Signaled when the extension system has completed its startup tasks. 86 // Signaled when the extension system has completed its startup tasks.
85 OneShotEvent ready_; 87 OneShotEvent ready_;
86 88
87 base::WeakPtrFactory<ShellExtensionSystem> weak_factory_; 89 base::WeakPtrFactory<ShellExtensionSystem> weak_factory_;
88 90
89 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem); 91 DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystem);
90 }; 92 };
91 93
92 } // namespace extensions 94 } // namespace extensions
93 95
94 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ 96 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698