summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_view_host.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 18:05:56 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 18:05:56 +0000
commit8b8e7c9bce4198a4ee2865d9dfce6e8baa173ad3 (patch)
tree938304b8e1be417c1b9c73d7463dacbc1da79843 /chrome/browser/renderer_host/render_view_host.cc
parentf2c4ee3627e6039fd42bd7c0c93e902b72653449 (diff)
downloadchromium_src-8b8e7c9bce4198a4ee2865d9dfce6e8baa173ad3.zip
chromium_src-8b8e7c9bce4198a4ee2865d9dfce6e8baa173ad3.tar.gz
chromium_src-8b8e7c9bce4198a4ee2865d9dfce6e8baa173ad3.tar.bz2
Initial version of chrome.experimental.sidebar extension API.
BUG=51084 TEST=Run interactive_ui_tests and browser_tests. New: - sidebar Extension API (design doc: https://docs.google.com/a/google.com/Doc?docid=0AV4Qg3xyZ8RQZGZtbWIydDJfNWc0eHJtbmRm&hl=en); - Sidebar panel in Chrome browser view; Original review=http://codereview.chromium.org/2836040/show Patch by alekseys@google.com git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_view_host.cc')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 9f1ea87..0ba65d6 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1279,11 +1279,6 @@ void RenderViewHost::OnMsgDOMUISend(
return;
}
- // 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;
scoped_ptr<Value> value;
if (!content.empty()) {
value.reset(base::JSONReader::Read(content, false));
@@ -1295,11 +1290,18 @@ void RenderViewHost::OnMsgDOMUISend(
}
}
- delegate_->ProcessDOMUIMessage(message,
- static_cast<const ListValue*>(value.get()),
- source_url,
- kRequestId,
- kHasCallback);
+ ViewHostMsg_DomMessage_Params params;
+ params.name = message;
+ if (value.get())
+ params.arguments.Swap(static_cast<ListValue*>(value.get()));
+ params.source_url = source_url;
+ // DOMUI doesn't use these values yet.
+ // TODO(aa): When DOMUI is ported to ExtensionFunctionDispatcher, send real
+ // values here.
+ params.request_id = -1;
+ params.has_callback = false;
+ params.user_gesture = false;
+ delegate_->ProcessDOMUIMessage(params);
}
void RenderViewHost::OnMsgForwardMessageToExternalHost(
@@ -1904,21 +1906,17 @@ void RenderViewHost::OnRequestNotificationPermission(
}
}
-void RenderViewHost::OnExtensionRequest(const std::string& name,
- const ListValue& args,
- const GURL& source_url,
- int request_id,
- bool has_callback) {
+void RenderViewHost::OnExtensionRequest(
+ const ViewHostMsg_DomMessage_Params& params) {
if (!ChildProcessSecurityPolicy::GetInstance()->
HasExtensionBindings(process()->id())) {
// This can happen if someone uses window.open() to open an extension URL
// from a non-extension context.
- BlockExtensionRequest(request_id);
+ BlockExtensionRequest(params.request_id);
return;
}
- delegate_->ProcessDOMUIMessage(name, &args, source_url, request_id,
- has_callback);
+ delegate_->ProcessDOMUIMessage(params);
}
void RenderViewHost::SendExtensionResponse(int request_id, bool success,