| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 | 420 |
| 421 // Let the GuestViewManager know that a GuestView has been created. | 421 // Let the GuestViewManager know that a GuestView has been created. |
| 422 const std::string& view_type = *v8::String::Utf8Value(args[2]); | 422 const std::string& view_type = *v8::String::Utf8Value(args[2]); |
| 423 content::RenderThread::Get()->Send( | 423 content::RenderThread::Get()->Send( |
| 424 new GuestViewHostMsg_ViewCreated(view_instance_id, view_type)); | 424 new GuestViewHostMsg_ViewCreated(view_instance_id, view_type)); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void GuestViewInternalCustomBindings::RunWithGesture( | 427 void GuestViewInternalCustomBindings::RunWithGesture( |
| 428 const v8::FunctionCallbackInfo<v8::Value>& args) { | 428 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 429 // Gesture is required to request fullscreen. | 429 // Gesture is required to request fullscreen. |
| 430 // TODO(devlin): All this needs to do is enter fullscreen. We should make this |
| 431 // EnterFullscreen() and do it directly rather than having a generic "run with |
| 432 // user gesture" function. |
| 430 blink::WebScopedUserGesture user_gesture(context()->web_frame()); | 433 blink::WebScopedUserGesture user_gesture(context()->web_frame()); |
| 431 CHECK_EQ(args.Length(), 1); | 434 CHECK_EQ(args.Length(), 1); |
| 432 CHECK(args[0]->IsFunction()); | 435 CHECK(args[0]->IsFunction()); |
| 433 v8::Local<v8::Value> no_args; | 436 context()->SafeCallFunction( |
| 434 context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args); | 437 v8::Local<v8::Function>::Cast(args[0]), 0, nullptr); |
| 435 } | 438 } |
| 436 | 439 |
| 437 } // namespace extensions | 440 } // namespace extensions |
| OLD | NEW |