Chromium Code Reviews| Index: extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc |
| diff --git a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc |
| index 7eb129236551ca24185357a5af7054915f95d7a7..b03784d8ddd20bc905da9531be6dda3f3b9cb287 100644 |
| --- a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc |
| +++ b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc |
| @@ -24,6 +24,7 @@ |
| #include "extensions/renderer/script_context.h" |
| #include "third_party/WebKit/public/web/WebFrame.h" |
| #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| +#include "third_party/WebKit/public/web/WebRemoteFrame.h" |
| #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
| #include "third_party/WebKit/public/web/WebView.h" |
| #include "v8/include/v8.h" |
| @@ -314,7 +315,13 @@ void GuestViewInternalCustomBindings::GetContentWindow( |
| return; |
| blink::WebFrame* frame = view->GetWebView()->mainFrame(); |
| - v8::Local<v8::Value> window = frame->mainWorldScriptContext()->Global(); |
| + v8::Local<v8::Value> window; |
|
Fady Samuel
2015/09/14 15:42:46
nit: comment would be helpful
|
| + if (frame->isWebLocalFrame()) { |
| + window = frame->mainWorldScriptContext()->Global(); |
| + } else { |
| + window = |
| + frame->toWebRemoteFrame()->deprecatedMainWorldScriptContext()->Global(); |
| + } |
| args.GetReturnValue().Set(window); |
| } |