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

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 376033002: Adding MimeHandlerView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pending-zork-patch2
Patch Set: With the new attach approach Created 6 years, 4 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: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 4bd18307617782f42cb7ec55573853cb7097de1c..8bba08727be031824740d434f07039a720b5f29f 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -13,6 +13,7 @@
#include "content/common/view_messages.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "content/public/renderer/browser_plugin_delegate.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/browser_plugin/browser_plugin_bindings.h"
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
@@ -44,7 +45,8 @@ namespace content {
BrowserPlugin::BrowserPlugin(RenderViewImpl* render_view,
blink::WebFrame* frame,
- bool auto_navigate)
+ bool auto_navigate,
Fady Samuel 2014/08/29 18:52:31 How about taking in a BrowserPluginDelegate instea
lazyboy 2014/08/29 22:08:25 Done. Only downside is I don't know the browser_pl
+ const std::string& mime_type)
: attached_(false),
attach_pending_(false),
render_view_(render_view->AsWeakPtr()),
@@ -58,6 +60,7 @@ BrowserPlugin::BrowserPlugin(RenderViewImpl* render_view,
plugin_focused_(false),
visible_(true),
auto_navigate_(auto_navigate),
Fady Samuel 2014/08/29 18:52:31 Get rid of this.
lazyboy 2014/08/29 22:08:24 Done.
+ mime_type_(mime_type),
Fady Samuel 2014/08/29 18:52:31 Get rid of this.
lazyboy 2014/08/29 22:08:24 Done.
mouse_locked_(false),
browser_plugin_manager_(render_view->GetBrowserPluginManager()),
browser_plugin_instance_id_(browser_plugin::kInstanceIDNone),
@@ -397,6 +400,14 @@ bool BrowserPlugin::initialize(WebPluginContainer* container) {
// This is a way to notify observers of our attributes that this plugin is
// available in render tree.
browser_plugin_instance_id_ = browser_plugin_manager()->GetNextInstanceID();
+
+ if (auto_navigate_) {
+ delegate_.reset(GetContentClient()->renderer()->CreateBrowserPluginDelegate(
+ render_view_routing_id_,
+ browser_plugin_instance_id_,
+ mime_type_));
+ }
+
UpdateDOMAttribute("internalinstanceid",
base::IntToString(browser_plugin_instance_id_));
@@ -707,8 +718,8 @@ void BrowserPlugin::didReceiveData(const char* data, int data_length) {
void BrowserPlugin::didFinishLoading() {
if (auto_navigate_) {
- // TODO(lazyboy): Make |auto_navigate_| stuff work.
- UpdateDOMAttribute(content::browser_plugin::kAttributeSrc, html_string_);
+ if (delegate_)
+ delegate_->DidFinishLoading(html_string_);
}
}

Powered by Google App Engine
This is Rietveld 408576698