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

Unified Diff: extensions/browser/extension_user_script_loader.h

Issue 1056533002: Implement <webview>.addContentScript/removeContentScript API [2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webview_addremove_contentscripts_2
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/extension_user_script_loader.h
diff --git a/extensions/browser/extension_user_script_loader.h b/extensions/browser/extension_user_script_loader.h
index 5ca40605a74a645bd69ef5e2fe8a3dada68be065..1bd747a65b3ed853b2e679cc6e5f27c55750fd32 100644
--- a/extensions/browser/extension_user_script_loader.h
+++ b/extensions/browser/extension_user_script_loader.h
@@ -30,10 +30,18 @@ class ExtensionUserScriptLoader : public UserScriptLoader,
bool listen_for_extension_system_loaded);
~ExtensionUserScriptLoader() override;
+ // A wrapper around the method to load user scripts, which is normally run on
+ // the file thread. Exposed only for tests.
+ void LoadScriptsForTest(UserScriptList* user_scripts);
+
private:
// UserScriptLoader:
- void UpdateHostsInfo(const std::set<HostID>& changed_hosts) override;
- LoadUserScriptsContentFunction GetLoadUserScriptsFunction() override;
+ void LoadScripts(const std::set<HostID>& changed_hosts,
+ const std::set<int>& added_script_ids) override;
+
+ // Updates |hosts_info_| to contain info for each element of
+ // |changed_hosts_|.
+ void UpdateHostsInfo(const std::set<HostID>& changed_hosts);
// ExtensionRegistryObserver:
void OnExtensionUnloaded(content::BrowserContext* browser_context,
@@ -44,6 +52,12 @@ class ExtensionUserScriptLoader : public UserScriptLoader,
// to be ready.
void OnExtensionSystemReady();
+ // Maps host info needed for localization to a host ID.
+ HostsInfo hosts_info_;
+
+ // Manages content verification of the loaded user scripts.
+ scoped_refptr<ContentVerifier> content_verifier_;
+
ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
extension_registry_observer_;

Powered by Google App Engine
This is Rietveld 408576698