summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 18:36:46 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 18:36:46 +0000
commit173de1be12780200c62bae5c01965d51ac0eaa31 (patch)
tree5ab851b72e8012f49a4d80b281744a6b64d40753 /chrome/renderer/render_view.cc
parent1f2763de9d897fc2b0e6da4c2323b7d8ab70c687 (diff)
downloadchromium_src-173de1be12780200c62bae5c01965d51ac0eaa31.zip
chromium_src-173de1be12780200c62bae5c01965d51ac0eaa31.tar.gz
chromium_src-173de1be12780200c62bae5c01965d51ac0eaa31.tar.bz2
Step 1 at making Gears run in the renderer process (enabled by switch
"--gears-in-renderer"). Requires some changes to gears to work. Most things work if you disable the sandbox. One major hole is that update tasks don't report status to the appropriate renderer. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r--chrome/renderer/render_view.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 2d93886..0d57727 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -52,7 +52,9 @@
#include "chrome/common/resource_bundle.h"
#include "chrome/common/text_zoom.h"
#include "chrome/common/thumbnail_score.h"
+#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/renderer/about_handler.h"
+#include "chrome/renderer/chrome_plugin_host.h"
#include "chrome/renderer/debug_message_handler.h"
#include "chrome/renderer/localized_error.h"
#include "chrome/renderer/renderer_resources.h"
@@ -1659,13 +1661,28 @@ WebWidget* RenderView::CreatePopupWidget(WebView* webview) {
return widget->webwidget();
}
+static bool ShouldLoadPluginInProcess(const std::string& mime_type,
+ bool* is_gears) {
+ if (RenderProcess::ShouldLoadPluginsInProcess())
+ return true;
+
+ if (mime_type == "application/x-googlegears") {
+ *is_gears = true;
+ CommandLine cmd;
+ return cmd.HasSwitch(switches::kGearsInRenderer);
+ }
+
+ return false;
+}
+
WebPluginDelegate* RenderView::CreatePluginDelegate(
WebView* webview,
const GURL& url,
const std::string& mime_type,
const std::string& clsid,
std::string* actual_mime_type) {
- if (RenderProcess::ShouldLoadPluginsInProcess()) {
+ bool is_gears = false;
+ if (ShouldLoadPluginInProcess(mime_type, &is_gears)) {
std::wstring path;
RenderThread::current()->Send(
new ViewHostMsg_GetPluginPath(url, mime_type, clsid, &path,
@@ -1679,6 +1696,8 @@ WebPluginDelegate* RenderView::CreatePluginDelegate(
else
mime_type_to_use = mime_type;
+ if (is_gears)
+ ChromePluginLib::Create(path, GetCPBrowserFuncsForRenderer());
return WebPluginDelegateImpl::Create(path, mime_type_to_use, host_window_);
}