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/guest_view_internal_custom_bindings.h" | 5 #include "extensions/renderer/guest_view/guest_view_internal_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if (!view) | 340 if (!view) |
341 return; | 341 return; |
342 | 342 |
343 blink::WebFrame* frame = view->GetWebView()->mainFrame(); | 343 blink::WebFrame* frame = view->GetWebView()->mainFrame(); |
344 // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running | 344 // TODO(lazyboy,nasko): The WebLocalFrame branch is not used when running |
345 // on top of out-of-process iframes. Remove it once the code is converted. | 345 // on top of out-of-process iframes. Remove it once the code is converted. |
346 v8::Local<v8::Value> window; | 346 v8::Local<v8::Value> window; |
347 if (frame->isWebLocalFrame()) { | 347 if (frame->isWebLocalFrame()) { |
348 window = frame->mainWorldScriptContext()->Global(); | 348 window = frame->mainWorldScriptContext()->Global(); |
349 } else { | 349 } else { |
350 window = frame->toWebRemoteFrame()->globalProxy(); | 350 window = |
| 351 frame->toWebRemoteFrame()->deprecatedMainWorldScriptContext()->Global(); |
351 } | 352 } |
352 args.GetReturnValue().Set(window); | 353 args.GetReturnValue().Set(window); |
353 } | 354 } |
354 | 355 |
355 void GuestViewInternalCustomBindings::GetViewFromID( | 356 void GuestViewInternalCustomBindings::GetViewFromID( |
356 const v8::FunctionCallbackInfo<v8::Value>& args) { | 357 const v8::FunctionCallbackInfo<v8::Value>& args) { |
357 // Default to returning null. | 358 // Default to returning null. |
358 args.GetReturnValue().SetNull(); | 359 args.GetReturnValue().SetNull(); |
359 // There is one argument. | 360 // There is one argument. |
360 CHECK(args.Length() == 1); | 361 CHECK(args.Length() == 1); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 // EnterFullscreen() and do it directly rather than having a generic "run with | 458 // EnterFullscreen() and do it directly rather than having a generic "run with |
458 // user gesture" function. | 459 // user gesture" function. |
459 blink::WebScopedUserGesture user_gesture(context()->web_frame()); | 460 blink::WebScopedUserGesture user_gesture(context()->web_frame()); |
460 CHECK_EQ(args.Length(), 1); | 461 CHECK_EQ(args.Length(), 1); |
461 CHECK(args[0]->IsFunction()); | 462 CHECK(args[0]->IsFunction()); |
462 context()->SafeCallFunction( | 463 context()->SafeCallFunction( |
463 v8::Local<v8::Function>::Cast(args[0]), 0, nullptr); | 464 v8::Local<v8::Function>::Cast(args[0]), 0, nullptr); |
464 } | 465 } |
465 | 466 |
466 } // namespace extensions | 467 } // namespace extensions |
OLD | NEW |