Chromium Code Reviews| Index: content/browser/web_contents/web_contents_android.cc |
| diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc |
| index 1bef8a3c293fc4e4874296fb7f62aac40b68f9ae..f41a49a9b5f3e13d6c34997ce226344f73cf9713 100644 |
| --- a/content/browser/web_contents/web_contents_android.cc |
| +++ b/content/browser/web_contents/web_contents_android.cc |
| @@ -363,4 +363,23 @@ void WebContentsAndroid::EvaluateJavaScript(JNIEnv* env, |
| ConvertJavaStringToUTF16(env, script), js_callback); |
| } |
| +// TODO(sgurun) add support for posting a frame whose name is known (only |
| +// main frame is supported at this time, see crbug.com/389721) |
| +// TODO(sgurun) add support for passing message ports |
| +void WebContentsAndroid::PostMessageToFrame(JNIEnv* env, jobject obj, |
| + jstring frame_name, jstring message, jstring source_origin, |
| + jstring target_origin) { |
| + |
| + RenderViewHost* host = web_contents_->GetRenderViewHost(); |
| + if (!host) |
| + return; |
|
Ted C
2014/10/21 21:36:56
indented two too many
sgurun-gerrit only
2014/10/21 23:43:35
Done.
|
| + ViewMsg_PostMessage_Params params; |
| + params.source_origin = ConvertJavaStringToUTF16(env, source_origin); |
| + params.target_origin = ConvertJavaStringToUTF16(env, target_origin); |
| + params.data = ConvertJavaStringToUTF16(env, message); |
| + params.is_data_raw_string = true; |
| + params.source_routing_id = MSG_ROUTING_NONE; |
| + host->Send(new ViewMsg_PostMessageEvent(host->GetRoutingID(), params)); |
| +} |
| + |
| } // namespace content |