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 "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 v8::Context::Scope context_scope( | 235 v8::Context::Scope context_scope( |
236 render_frame()->GetWebFrame()->mainWorldScriptContext()); | 236 render_frame()->GetWebFrame()->mainWorldScriptContext()); |
237 | 237 |
238 // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running | 238 // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running |
239 // on top of out-of-process iframes. Remove it once the code is converted. | 239 // on top of out-of-process iframes. Remove it once the code is converted. |
240 v8::Local<v8::Object> guest_proxy_window; | 240 v8::Local<v8::Object> guest_proxy_window; |
241 if (guest_proxy_frame->isWebLocalFrame()) { | 241 if (guest_proxy_frame->isWebLocalFrame()) { |
242 guest_proxy_window = | 242 guest_proxy_window = |
243 guest_proxy_frame->mainWorldScriptContext()->Global(); | 243 guest_proxy_frame->mainWorldScriptContext()->Global(); |
244 } else { | 244 } else { |
245 guest_proxy_window = guest_proxy_frame->toWebRemoteFrame() | 245 guest_proxy_window = guest_proxy_frame->toWebRemoteFrame()->globalProxy(); |
246 ->deprecatedMainWorldScriptContext() | |
247 ->Global(); | |
248 } | 246 } |
249 gin::Dictionary window_object(isolate, guest_proxy_window); | 247 gin::Dictionary window_object(isolate, guest_proxy_window); |
250 v8::Local<v8::Function> post_message; | 248 v8::Local<v8::Function> post_message; |
251 if (!window_object.Get(std::string(kPostMessageName), &post_message)) | 249 if (!window_object.Get(std::string(kPostMessageName), &post_message)) |
252 return; | 250 return; |
253 | 251 |
254 v8::Local<v8::Value> args[] = { | 252 v8::Local<v8::Value> args[] = { |
255 message, | 253 message, |
256 // Post the message to any domain inside the browser plugin. The embedder | 254 // Post the message to any domain inside the browser plugin. The embedder |
257 // should already know what is embedded. | 255 // should already know what is embedded. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 if (!render_frame()) | 329 if (!render_frame()) |
332 return; | 330 return; |
333 | 331 |
334 render_frame()->Send( | 332 render_frame()->Send( |
335 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( | 333 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( |
336 render_frame()->GetRoutingID(), view_id_, element_instance_id(), | 334 render_frame()->GetRoutingID(), view_id_, element_instance_id(), |
337 element_size_)); | 335 element_size_)); |
338 } | 336 } |
339 | 337 |
340 } // namespace extensions | 338 } // namespace extensions |
OLD | NEW |