OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_EXTENSION_USER_SCRIPT_LOADER_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_USER_SCRIPT_LOADER_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_USER_SCRIPT_LOADER_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_USER_SCRIPT_LOADER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "extensions/browser/extension_registry_observer.h" | 9 #include "extensions/browser/extension_registry_observer.h" |
10 #include "extensions/browser/user_script_loader.h" | 10 #include "extensions/browser/user_script_loader.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 const HostID& host_id, | 33 const HostID& host_id, |
34 bool listen_for_extension_system_loaded); | 34 bool listen_for_extension_system_loaded); |
35 ~ExtensionUserScriptLoader() override; | 35 ~ExtensionUserScriptLoader() override; |
36 | 36 |
37 // A wrapper around the method to load user scripts, which is normally run on | 37 // A wrapper around the method to load user scripts, which is normally run on |
38 // the file thread. Exposed only for tests. | 38 // the file thread. Exposed only for tests. |
39 void LoadScriptsForTest(UserScriptList* user_scripts); | 39 void LoadScriptsForTest(UserScriptList* user_scripts); |
40 | 40 |
41 private: | 41 private: |
42 // UserScriptLoader: | 42 // UserScriptLoader: |
43 void LoadScripts(scoped_ptr<UserScriptList> user_scripts, | 43 void LoadScripts(std::unique_ptr<UserScriptList> user_scripts, |
44 const std::set<HostID>& changed_hosts, | 44 const std::set<HostID>& changed_hosts, |
45 const std::set<int>& added_script_ids, | 45 const std::set<int>& added_script_ids, |
46 LoadScriptsCallback callback) override; | 46 LoadScriptsCallback callback) override; |
47 | 47 |
48 // Updates |hosts_info_| to contain info for each element of | 48 // Updates |hosts_info_| to contain info for each element of |
49 // |changed_hosts_|. | 49 // |changed_hosts_|. |
50 void UpdateHostsInfo(const std::set<HostID>& changed_hosts); | 50 void UpdateHostsInfo(const std::set<HostID>& changed_hosts); |
51 | 51 |
52 // ExtensionRegistryObserver: | 52 // ExtensionRegistryObserver: |
53 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 53 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
(...skipping 14 matching lines...) Expand all Loading... |
68 extension_registry_observer_; | 68 extension_registry_observer_; |
69 | 69 |
70 base::WeakPtrFactory<ExtensionUserScriptLoader> weak_factory_; | 70 base::WeakPtrFactory<ExtensionUserScriptLoader> weak_factory_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(ExtensionUserScriptLoader); | 72 DISALLOW_COPY_AND_ASSIGN(ExtensionUserScriptLoader); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace extensions | 75 } // namespace extensions |
76 | 76 |
77 #endif // EXTENSIONS_BROWSER_EXTENSION_USER_SCRIPT_LOADER_H_ | 77 #endif // EXTENSIONS_BROWSER_EXTENSION_USER_SCRIPT_LOADER_H_ |
OLD | NEW |