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

Unified Diff: chrome/renderer/extensions/document_custom_bindings.cc

Issue 23530029: Support webview tag when the container extension is embedded in a webUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 7 years, 3 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: chrome/renderer/extensions/document_custom_bindings.cc
diff --git a/chrome/renderer/extensions/document_custom_bindings.cc b/chrome/renderer/extensions/document_custom_bindings.cc
index 36406c234bf8b6af81815dfeeed651caca2634c5..253b6127f358417c2c39f01c661e53930a12d813 100644
--- a/chrome/renderer/extensions/document_custom_bindings.cc
+++ b/chrome/renderer/extensions/document_custom_bindings.cc
@@ -7,10 +7,9 @@
#include <string>
#include "base/bind.h"
-#include "content/public/renderer/render_view.h"
+#include "chrome/renderer/extensions/chrome_v8_context.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.h"
-#include "third_party/WebKit/public/web/WebView.h"
#include "v8/include/v8.h"
namespace extensions {
@@ -26,16 +25,6 @@ DocumentCustomBindings::DocumentCustomBindings(
// Attach an event name to an object.
void DocumentCustomBindings::RegisterElement(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- content::RenderView* render_view = GetRenderView();
- if (!render_view) {
- return;
- }
-
- WebKit::WebView* web_view = render_view->GetWebView();
- if (!web_view) {
- return;
- }
-
if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsObject()) {
NOTREACHED();
return;
@@ -45,7 +34,7 @@ void DocumentCustomBindings::RegisterElement(
v8::Local<v8::Object> options = args[1]->ToObject();
WebKit::WebExceptionCode ec = 0;
- WebKit::WebDocument document = web_view->mainFrame()->document();
+ WebKit::WebDocument document = context()->web_frame()->document();
v8::Handle<v8::Value> constructor =
document.registerEmbedderCustomElement(
WebKit::WebString::fromUTF8(element_name), options, ec);
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/browser/browser_plugin/browser_plugin_embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698