diff options
author | hanxi <hanxi@chromium.org> | 2014-12-12 13:53:46 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-12 21:54:00 +0000 |
commit | 6d9b43a5c431b04947bdc135b179166e55199efa (patch) | |
tree | 67c07184ab049c6b3a8e4d0b2bd98cb17caf5118 /chrome/browser/extensions/extension_system_impl.h | |
parent | c489fa833c62edf608a6ecbf553036fe9d7a3292 (diff) | |
download | chromium_src-6d9b43a5c431b04947bdc135b179166e55199efa.zip chromium_src-6d9b43a5c431b04947bdc135b179166e55199efa.tar.gz chromium_src-6d9b43a5c431b04947bdc135b179166e55199efa.tar.bz2 |
This CL introduce DeclarativeUserScriptManager to manager a set of DeclarativeUserScriptMaster objects which were stored in the ExtensionSystemImpl.
With this refactor, it allows the DeclarativeUserScriptManager to take care of the creations of DeclarativeUserScriptMaster objects:
1) It enable the DeclarativeUserScriptManager accept all kinds of input keys and convert them as a uniform format;
2) The manager will assign a unique ID to the consumer who requests a DeclarativeUserScriptMaster object.The consumer can use this ID to do script injection.
(The above two steps will be implemented in another CLs)
This refactor is a part of issue "support DeclarativeContent script injection on <webview>", please refer to a design doc(https://goto.google.com/introduceidforscriptinjection).
BUG=437566
Review URL: https://codereview.chromium.org/796453003
Cr-Commit-Position: refs/heads/master@{#308171}
Diffstat (limited to 'chrome/browser/extensions/extension_system_impl.h')
-rw-r--r-- | chrome/browser/extensions/extension_system_impl.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/chrome/browser/extensions/extension_system_impl.h b/chrome/browser/extensions/extension_system_impl.h index bb2a21e..416d5a1 100644 --- a/chrome/browser/extensions/extension_system_impl.h +++ b/chrome/browser/extensions/extension_system_impl.h @@ -9,12 +9,12 @@ #include "extensions/browser/extension_system.h" #include "extensions/common/one_shot_event.h" +class DeclarativeUserScriptManager; class Profile; namespace extensions { class ContentVerifier; -class DeclarativeUserScriptMaster; class ExtensionSystemSharedFactory; class NavigationObserver; class SharedUserScriptMaster; @@ -38,8 +38,9 @@ class ExtensionSystemImpl : public ExtensionSystem { ExtensionService* extension_service() override; // shared RuntimeData* runtime_data() override; // shared ManagementPolicy* management_policy() override; // shared - // shared - SharedUserScriptMaster* shared_user_script_master() override; + SharedUserScriptMaster* shared_user_script_master() override; // shared + DeclarativeUserScriptManager* declarative_user_script_manager() + override; // shared StateStore* state_store() override; // shared StateStore* rules_store() override; // shared LazyBackgroundTaskQueue* lazy_background_task_queue() override; // shared @@ -61,9 +62,6 @@ class ExtensionSystemImpl : public ExtensionSystem { scoped_ptr<ExtensionSet> GetDependentExtensions( const Extension* extension) override; - DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension( - const ExtensionId& extension_id) override; // shared - private: friend class ExtensionSystemSharedFactory; @@ -89,6 +87,7 @@ class ExtensionSystemImpl : public ExtensionSystem { RuntimeData* runtime_data(); ManagementPolicy* management_policy(); SharedUserScriptMaster* shared_user_script_master(); + DeclarativeUserScriptManager* declarative_user_script_manager(); InfoMap* info_map(); LazyBackgroundTaskQueue* lazy_background_task_queue(); EventRouter* event_router(); @@ -98,9 +97,6 @@ class ExtensionSystemImpl : public ExtensionSystem { const OneShotEvent& ready() const { return ready_; } ContentVerifier* content_verifier(); - DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByExtension( - const ExtensionId& extension_id); - private: Profile* profile_; @@ -118,10 +114,9 @@ class ExtensionSystemImpl : public ExtensionSystem { // Shared memory region manager for scripts statically declared in extension // manifests. This region is shared between all extensions. scoped_ptr<SharedUserScriptMaster> shared_user_script_master_; - // Shared memory region manager for programmatically declared scripts, one - // per extension. Managers are instantiated the first time the declarative - // API is used by an extension to request content scripts. - ScopedVector<DeclarativeUserScriptMaster> declarative_user_script_masters_; + // Manager of a set of DeclarativeUserScript objects for programmatically + // declared scripts. + scoped_ptr<DeclarativeUserScriptManager> declarative_user_script_manager_; scoped_ptr<RuntimeData> runtime_data_; // ExtensionService depends on StateStore, Blacklist and RuntimeData. scoped_ptr<ExtensionService> extension_service_; |