summaryrefslogtreecommitdiffstats
path: root/extensions/shell/renderer
diff options
context:
space:
mode:
authorjamescook <jamescook@chromium.org>2014-11-19 16:49:49 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-20 00:50:03 +0000
commit4d8d72ef85260841830d4215f0fcfaf9d49fd5b6 (patch)
tree5bdcfa58415a399e82368b1a27565725f12bd90c /extensions/shell/renderer
parent91b70a2fb6f89efc9bf3f6ec191bfa8846796285 (diff)
downloadchromium_src-4d8d72ef85260841830d4215f0fcfaf9d49fd5b6.zip
chromium_src-4d8d72ef85260841830d4215f0fcfaf9d49fd5b6.tar.gz
chromium_src-4d8d72ef85260841830d4215f0fcfaf9d49fd5b6.tar.bz2
Allow app_shell embedders to override extensions client interfaces
This includes ExtensionsClient and ExtensionsBrowserClient. BUG=none TEST=app_shell_unittests Review URL: https://codereview.chromium.org/717233003 Cr-Commit-Position: refs/heads/master@{#304946}
Diffstat (limited to 'extensions/shell/renderer')
-rw-r--r--extensions/shell/renderer/shell_content_renderer_client.cc6
-rw-r--r--extensions/shell/renderer/shell_content_renderer_client.h9
2 files changed, 12 insertions, 3 deletions
diff --git a/extensions/shell/renderer/shell_content_renderer_client.cc b/extensions/shell/renderer/shell_content_renderer_client.cc
index 216eac6..a56c009 100644
--- a/extensions/shell/renderer/shell_content_renderer_client.cc
+++ b/extensions/shell/renderer/shell_content_renderer_client.cc
@@ -79,7 +79,7 @@ ShellContentRendererClient::~ShellContentRendererClient() {
void ShellContentRendererClient::RenderThreadStarted() {
RenderThread* thread = RenderThread::Get();
- extensions_client_.reset(new ShellExtensionsClient);
+ extensions_client_.reset(CreateExtensionsClient());
ExtensionsClient::Set(extensions_client_.get());
extensions_renderer_client_.reset(new ShellExtensionsRendererClient);
@@ -189,4 +189,8 @@ ShellContentRendererClient::CreateBrowserPluginDelegate(
}
}
+ExtensionsClient* ShellContentRendererClient::CreateExtensionsClient() {
+ return new ShellExtensionsClient;
+}
+
} // namespace extensions
diff --git a/extensions/shell/renderer/shell_content_renderer_client.h b/extensions/shell/renderer/shell_content_renderer_client.h
index 6f62398..b86fa0e 100644
--- a/extensions/shell/renderer/shell_content_renderer_client.h
+++ b/extensions/shell/renderer/shell_content_renderer_client.h
@@ -14,7 +14,7 @@ namespace extensions {
class Dispatcher;
class DispatcherDelegate;
-class ShellExtensionsClient;
+class ExtensionsClient;
class ShellExtensionsRendererClient;
class ShellRendererMainDelegate;
@@ -52,8 +52,13 @@ class ShellContentRendererClient : public content::ContentRendererClient {
const std::string& mime_type,
const GURL& original_url) override;
+ protected:
+ // app_shell embedders may need custom extensions client interfaces.
+ // This class takes ownership of the returned object.
+ virtual ExtensionsClient* CreateExtensionsClient();
+
private:
- scoped_ptr<ShellExtensionsClient> extensions_client_;
+ scoped_ptr<ExtensionsClient> extensions_client_;
scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_;
scoped_ptr<DispatcherDelegate> extension_dispatcher_delegate_;
scoped_ptr<Dispatcher> extension_dispatcher_;