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()->globalProxy(); | 245 guest_proxy_window = guest_proxy_frame->toWebRemoteFrame() |
| 246 ->deprecatedMainWorldScriptContext() |
| 247 ->Global(); |
246 } | 248 } |
247 gin::Dictionary window_object(isolate, guest_proxy_window); | 249 gin::Dictionary window_object(isolate, guest_proxy_window); |
248 v8::Local<v8::Function> post_message; | 250 v8::Local<v8::Function> post_message; |
249 if (!window_object.Get(std::string(kPostMessageName), &post_message)) | 251 if (!window_object.Get(std::string(kPostMessageName), &post_message)) |
250 return; | 252 return; |
251 | 253 |
252 v8::Local<v8::Value> args[] = { | 254 v8::Local<v8::Value> args[] = { |
253 message, | 255 message, |
254 // Post the message to any domain inside the browser plugin. The embedder | 256 // Post the message to any domain inside the browser plugin. The embedder |
255 // should already know what is embedded. | 257 // should already know what is embedded. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (!render_frame()) | 331 if (!render_frame()) |
330 return; | 332 return; |
331 | 333 |
332 render_frame()->Send( | 334 render_frame()->Send( |
333 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( | 335 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( |
334 render_frame()->GetRoutingID(), view_id_, element_instance_id(), | 336 render_frame()->GetRoutingID(), view_id_, element_instance_id(), |
335 element_size_)); | 337 element_size_)); |
336 } | 338 } |
337 | 339 |
338 } // namespace extensions | 340 } // namespace extensions |
OLD | NEW |