| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_con
tainer.h" | 5 #include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_con
tainer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "content/public/child/v8_value_converter.h" | 10 #include "content/public/child/v8_value_converter.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 v8::Context::Scope context_scope( | 227 v8::Context::Scope context_scope( |
| 228 render_frame()->GetWebFrame()->mainWorldScriptContext()); | 228 render_frame()->GetWebFrame()->mainWorldScriptContext()); |
| 229 v8::Local<v8::Object> guest_proxy_window = | 229 v8::Local<v8::Object> guest_proxy_window = |
| 230 guest_proxy_frame->mainWorldScriptContext()->Global(); | 230 guest_proxy_frame->mainWorldScriptContext()->Global(); |
| 231 gin::Dictionary window_object(isolate, guest_proxy_window); | 231 gin::Dictionary window_object(isolate, guest_proxy_window); |
| 232 v8::Handle<v8::Function> post_message; | 232 v8::Handle<v8::Function> post_message; |
| 233 if (!window_object.Get(std::string(kPostMessageName), &post_message)) | 233 if (!window_object.Get(std::string(kPostMessageName), &post_message)) |
| 234 return; | 234 return; |
| 235 | 235 |
| 236 #ifdef WEB_FRAME_USES_V8_LOCAL |
| 237 v8::Local<v8::Value> args[] = { |
| 238 #else |
| 236 v8::Handle<v8::Value> args[] = { | 239 v8::Handle<v8::Value> args[] = { |
| 240 #endif |
| 237 message, | 241 message, |
| 238 // Post the message to any domain inside the browser plugin. The embedder | 242 // Post the message to any domain inside the browser plugin. The embedder |
| 239 // should already know what is embedded. | 243 // should already know what is embedded. |
| 240 gin::StringToV8(isolate, "*") | 244 gin::StringToV8(isolate, "*") |
| 241 }; | 245 }; |
| 242 guest_proxy_frame->callFunctionEvenIfScriptDisabled( | 246 guest_proxy_frame->callFunctionEvenIfScriptDisabled( |
| 243 post_message.As<v8::Function>(), | 247 post_message.As<v8::Function>(), |
| 244 guest_proxy_window, | 248 guest_proxy_window, |
| 245 arraysize(args), | 249 arraysize(args), |
| 246 args); | 250 args); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 314 |
| 311 if (!render_frame()) | 315 if (!render_frame()) |
| 312 return; | 316 return; |
| 313 | 317 |
| 314 render_frame()->Send(new GuestViewHostMsg_CreateMimeHandlerViewGuest( | 318 render_frame()->Send(new GuestViewHostMsg_CreateMimeHandlerViewGuest( |
| 315 render_frame()->GetRoutingID(), view_id_, element_instance_id(), | 319 render_frame()->GetRoutingID(), view_id_, element_instance_id(), |
| 316 element_size_)); | 320 element_size_)); |
| 317 } | 321 } |
| 318 | 322 |
| 319 } // namespace extensions | 323 } // namespace extensions |
| OLD | NEW |