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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 126137: Part 1 of merging Extensions and DOMUI (Closed)
Patch Set: add test and rebase Created 11 years, 6 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/browser/renderer_host/render_view_host.cc
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 87f4bf0a19f5ce418dad7d1c6d9b553570c41ca5..44d4db100d805ee03239e72e36a69c9668f6e269 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -42,7 +42,6 @@
#endif
using base::TimeDelta;
-using webkit_glue::AutofillForm;
using webkit_glue::PasswordFormDomManager;
using WebKit::WebConsoleMessage;
using WebKit::WebFindOptions;
@@ -570,24 +569,9 @@ void RenderViewHost::DragSourceSystemDragEnded() {
Send(new ViewMsg_DragSourceSystemDragEnded(routing_id()));
}
-void RenderViewHost::AllowDomAutomationBindings() {
+void RenderViewHost::AllowBindings(int bindings_flags) {
DCHECK(!renderer_initialized_);
- enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION;
-}
-
-void RenderViewHost::AllowExternalHostBindings() {
- DCHECK(!renderer_initialized_);
- enabled_bindings_ |= BindingsPolicy::EXTERNAL_HOST;
-}
-
-void RenderViewHost::AllowDOMUIBindings() {
- DCHECK(!renderer_initialized_);
- enabled_bindings_ |= BindingsPolicy::DOM_UI;
-}
-
-void RenderViewHost::AllowExtensionBindings() {
- DCHECK(!renderer_initialized_);
- enabled_bindings_ |= BindingsPolicy::EXTENSION;
+ enabled_bindings_ |= bindings_flags;
}
void RenderViewHost::SetDOMUIProperty(const std::string& name,
@@ -883,15 +867,6 @@ void RenderViewHost::OnMsgNavigate(const IPC::Message& msg) {
FilterURL(policy, renderer_id, &validated_params.password_form.origin);
FilterURL(policy, renderer_id, &validated_params.password_form.action);
- if (PageTransition::IsMainFrame(validated_params.transition)) {
- ExtensionFunctionDispatcher* new_efd = NULL;
- if (validated_params.url.SchemeIs(chrome::kExtensionScheme)) {
- new_efd = delegate()->CreateExtensionFunctionDispatcher(this,
- validated_params.url.host());
- }
- extension_function_dispatcher_.reset(new_efd);
- }
-
delegate_->DidNavigate(this, validated_params);
UpdateBackForwardListCount();
@@ -1071,7 +1046,14 @@ void RenderViewHost::OnMsgDOMUISend(
NOTREACHED() << "Blocked unauthorized use of DOMUIBindings.";
return;
}
- delegate_->ProcessDOMUIMessage(message, content);
+
+ // DOMUI doesn't use these values yet.
+ // TODO(aa): When DOMUI is ported to ExtensionFunctionDispatcher, send real
+ // values here.
+ const int kRequestId = -1;
+ const bool kHasCallback = false;
+
+ delegate_->ProcessDOMUIMessage(message, content, kRequestId, kHasCallback);
}
void RenderViewHost::OnMsgForwardMessageToExternalHost(
@@ -1155,7 +1137,7 @@ void RenderViewHost::OnMsgPasswordFormsSeen(
}
void RenderViewHost::OnMsgAutofillFormSubmitted(
- const AutofillForm& form) {
+ const webkit_glue::AutofillForm& form) {
delegate_->AutofillFormSubmitted(form);
}
@@ -1368,9 +1350,7 @@ void RenderViewHost::OnExtensionRequest(const std::string& name,
return;
}
- DCHECK(extension_function_dispatcher_.get());
- extension_function_dispatcher_->HandleRequest(name, args, request_id,
- has_callback);
+ delegate_->ProcessDOMUIMessage(name, args, request_id, has_callback);
}
void RenderViewHost::SendExtensionResponse(int request_id, bool success,
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698