OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_USER_SCRIPT_LOADER_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_USER_SCRIPT_LOADER_H_ | |
7 | |
8 #include "base/memory/shared_memory.h" | |
9 #include "chrome/browser/extensions/user_script_loader.h" | |
10 #include "extensions/browser/extension_registry_observer.h" | |
11 #include "extensions/common/extension.h" | |
12 | |
13 namespace content { | |
14 class BrowserContext; | |
15 } | |
16 | |
17 class Profile; | |
18 | |
19 namespace extensions { | |
20 | |
21 class ContentVerifier; | |
Devlin
2015/01/26 20:12:08
Delete.
Xi Han
2015/01/26 23:27:53
Done.
| |
22 class ExtensionRegistry; | |
23 | |
24 // UserScriptLoader for extensions. | |
25 class ExtensionUserScriptLoader : public UserScriptLoader, | |
26 public ExtensionRegistryObserver { | |
27 public: | |
28 // The listen_for_extension_system_loaded is only set true when initilizing | |
29 // the Exttension System, e.g, when constructs SharedUserScriptMaster in | |
30 // ExtensionSystemImpl. | |
31 ExtensionUserScriptLoader(Profile* profile, | |
32 const HostID& host_id, | |
33 bool listen_for_extension_system_loaded); | |
34 ~ExtensionUserScriptLoader() override; | |
35 | |
36 private: | |
37 // UserScriptLoader: | |
38 void UpdateHostsInfo(const std::set<HostID>& changed_hosts) override; | |
39 LoadUserScriptsContentFunction GetLoadUserScriptsFunction() override; | |
40 | |
41 // ExtensionRegistryObserver: | |
42 void OnExtensionUnloaded(content::BrowserContext* browser_context, | |
43 const Extension* extension, | |
44 UnloadedExtensionInfo::Reason reason) override; | |
45 | |
46 // Initiates script load when we have been waiting for the extension system | |
47 // to be ready. | |
48 void OnExtensionSystemReady(); | |
49 | |
50 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | |
51 extension_registry_observer_; | |
52 | |
53 base::WeakPtrFactory<ExtensionUserScriptLoader> weak_factory_; | |
54 | |
55 DISALLOW_COPY_AND_ASSIGN(ExtensionUserScriptLoader); | |
56 }; | |
57 | |
58 } // namespace extensions | |
59 | |
60 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_USER_SCRIPT_LOADER_H_ | |
OLD | NEW |