Index: content/browser/android/content_view_core_impl.cc |
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
index 16e83d8a457ae3969bb8eed13a164c4879ec6290..6d27cdbbd9219e1fc0cb098b2133d159efaa52e9 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -1423,6 +1423,26 @@ void ContentViewCoreImpl::EvaluateJavaScript(JNIEnv* env, |
c_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 ContentViewCoreImpl::PostMessageToFrame(JNIEnv* env, jobject obj, |
+ jstring frame_name, jstring message, jstring source_origin, |
+ jstring target_origin) { |
+ |
+ RenderViewHost* host = web_contents_->GetRenderViewHost(); |
+ 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; |
+ // TODO(sgurun) What is the right value here? |
+ params.source_routing_id = MSG_ROUTING_NONE; |
+ if (host) |
mnaganov (inactive)
2014/07/14 15:19:29
nit: bail out early if there is no host?
sgurun-gerrit only
2014/07/16 00:43:28
Done.
|
+ host->Send(new ViewMsg_PostMessageEvent(host->GetRoutingID(), params)); |
+} |
+ |
+ |
bool ContentViewCoreImpl::GetUseDesktopUserAgent( |
JNIEnv* env, jobject obj) { |
NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry(); |