| 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 | |
| 239 v8::Handle<v8::Value> args[] = { | 236 v8::Handle<v8::Value> args[] = { |
| 240 #endif | |
| 241 message, | 237 message, |
| 242 // Post the message to any domain inside the browser plugin. The embedder | 238 // Post the message to any domain inside the browser plugin. The embedder |
| 243 // should already know what is embedded. | 239 // should already know what is embedded. |
| 244 gin::StringToV8(isolate, "*") | 240 gin::StringToV8(isolate, "*") |
| 245 }; | 241 }; |
| 246 guest_proxy_frame->callFunctionEvenIfScriptDisabled( | 242 guest_proxy_frame->callFunctionEvenIfScriptDisabled( |
| 247 post_message.As<v8::Function>(), | 243 post_message.As<v8::Function>(), |
| 248 guest_proxy_window, | 244 guest_proxy_window, |
| 249 arraysize(args), | 245 arraysize(args), |
| 250 args); | 246 args); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 310 |
| 315 if (!render_frame()) | 311 if (!render_frame()) |
| 316 return; | 312 return; |
| 317 | 313 |
| 318 render_frame()->Send(new GuestViewHostMsg_CreateMimeHandlerViewGuest( | 314 render_frame()->Send(new GuestViewHostMsg_CreateMimeHandlerViewGuest( |
| 319 render_frame()->GetRoutingID(), view_id_, element_instance_id(), | 315 render_frame()->GetRoutingID(), view_id_, element_instance_id(), |
| 320 element_size_)); | 316 element_size_)); |
| 321 } | 317 } |
| 322 | 318 |
| 323 } // namespace extensions | 319 } // namespace extensions |
| OLD | NEW |