summaryrefslogtreecommitdiffstats
path: root/apps/custom_launcher_page_contents.cc
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-06-10 16:32:41 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-10 23:33:30 +0000
commitcb2ec659ab8741962f3391970a5fff512ebb6509 (patch)
tree84c87ca2540a0f0e7dc66bb0b82a5abc79ad012b /apps/custom_launcher_page_contents.cc
parent1bcab9592f6213b9f44379bb66ce7b613b371e0b (diff)
downloadchromium_src-cb2ec659ab8741962f3391970a5fff512ebb6509.zip
chromium_src-cb2ec659ab8741962f3391970a5fff512ebb6509.tar.gz
chromium_src-cb2ec659ab8741962f3391970a5fff512ebb6509.tar.bz2
[Extensions] Clean up the handling of ExtensionHostMsg_Request
ExtensionHostMsg_Request is sent when an extension calls an API function. Before this patch, this IPC would be sent to one of 11 different call sites, all of which then routed it to the ExtensionFunctionDispatcher - and all of which have to implement ExtensionFunctionDispatcher::Delegate. Instead, have ExtensionWebContentsObserver handle the IPC, since it is created (or should be) for all extension web contents. This also lets us eliminate many (though not all) of the ExtensionFunctionDispatcher::Delegate implementations (I will try to clean more up in a later patch). The size of this patch is due to a number of yaks that needed shaving along the way - in particular, around GuestView. BUG=498017 BUG=405246 Review URL: https://codereview.chromium.org/1169223002 Cr-Commit-Position: refs/heads/master@{#333843}
Diffstat (limited to 'apps/custom_launcher_page_contents.cc')
-rw-r--r--apps/custom_launcher_page_contents.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/apps/custom_launcher_page_contents.cc b/apps/custom_launcher_page_contents.cc
index 20744b3..8888993 100644
--- a/apps/custom_launcher_page_contents.cc
+++ b/apps/custom_launcher_page_contents.cc
@@ -30,14 +30,10 @@ CustomLauncherPageContents::~CustomLauncherPageContents() {
void CustomLauncherPageContents::Initialize(content::BrowserContext* context,
const GURL& url) {
- extension_function_dispatcher_.reset(
- new extensions::ExtensionFunctionDispatcher(context, this));
-
web_contents_.reset(
content::WebContents::Create(content::WebContents::CreateParams(
context, content::SiteInstance::CreateForURL(context, url))));
- Observe(web_contents());
web_contents_->GetMutableRendererPrefs()
->browser_handles_all_top_level_requests = true;
web_contents_->GetRenderViewHost()->SyncRendererPrefs();
@@ -135,30 +131,4 @@ bool CustomLauncherPageContents::CheckMediaAccessPermission(
return helper_->CheckMediaAccessPermission(security_origin, type);
}
-bool CustomLauncherPageContents::OnMessageReceived(
- const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(CustomLauncherPageContents, message)
- IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-extensions::WindowController*
-CustomLauncherPageContents::GetExtensionWindowController() const {
- return NULL;
-}
-
-content::WebContents* CustomLauncherPageContents::GetAssociatedWebContents()
- const {
- return web_contents();
-}
-
-void CustomLauncherPageContents::OnRequest(
- const ExtensionHostMsg_Request_Params& params) {
- extension_function_dispatcher_->Dispatch(params,
- web_contents_->GetRenderViewHost());
-}
-
} // namespace apps