Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: a Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 // Let the GuestViewManager know that a GuestView has been created. 422 // Let the GuestViewManager know that a GuestView has been created.
423 const std::string& view_type = *v8::String::Utf8Value(args[2]); 423 const std::string& view_type = *v8::String::Utf8Value(args[2]);
424 content::RenderThread::Get()->Send( 424 content::RenderThread::Get()->Send(
425 new GuestViewHostMsg_ViewCreated(view_instance_id, view_type)); 425 new GuestViewHostMsg_ViewCreated(view_instance_id, view_type));
426 } 426 }
427 427
428 void GuestViewInternalCustomBindings::RunWithGesture( 428 void GuestViewInternalCustomBindings::RunWithGesture(
429 const v8::FunctionCallbackInfo<v8::Value>& args) { 429 const v8::FunctionCallbackInfo<v8::Value>& args) {
430 // Gesture is required to request fullscreen. 430 // Gesture is required to request fullscreen.
431 blink::WebScopedUserGesture user_gesture; 431 blink::WebScopedUserGesture user_gesture(context()->web_frame());
432 CHECK_EQ(args.Length(), 1); 432 CHECK_EQ(args.Length(), 1);
433 CHECK(args[0]->IsFunction()); 433 CHECK(args[0]->IsFunction());
434 v8::Local<v8::Value> no_args; 434 v8::Local<v8::Value> no_args;
435 context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args); 435 context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args);
436 } 436 }
437 437
438 } // namespace extensions 438 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698