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

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

Issue 1102173002: Move GuestView layer in browser to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Jochen's comment + GuestViewBase cleanup Created 5 years, 7 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 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "components/guest_view/common/guest_view_constants.h"
10 #include "content/public/child/v8_value_converter.h" 11 #include "content/public/child/v8_value_converter.h"
11 #include "content/public/renderer/render_view.h" 12 #include "content/public/renderer/render_view.h"
12 #include "extensions/common/extension.h" 13 #include "extensions/common/extension.h"
13 #include "extensions/common/extension_messages.h" 14 #include "extensions/common/extension_messages.h"
14 #include "extensions/common/guest_view/guest_view_constants.h"
15 #include "extensions/renderer/guest_view/extensions_guest_view_container.h" 15 #include "extensions/renderer/guest_view/extensions_guest_view_container.h"
16 #include "extensions/renderer/script_context.h" 16 #include "extensions/renderer/script_context.h"
17 #include "third_party/WebKit/public/web/WebFrame.h" 17 #include "third_party/WebKit/public/web/WebFrame.h"
18 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" 18 #include "third_party/WebKit/public/web/WebScopedUserGesture.h"
19 #include "third_party/WebKit/public/web/WebView.h" 19 #include "third_party/WebKit/public/web/WebView.h"
20 #include "v8/include/v8.h" 20 #include "v8/include/v8.h"
21 21
22 using content::V8ValueConverter; 22 using content::V8ValueConverter;
23 23
24 namespace extensions { 24 namespace extensions {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); 80 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
81 scoped_ptr<base::Value> params_as_value( 81 scoped_ptr<base::Value> params_as_value(
82 converter->FromV8Value(args[2], context()->v8_context())); 82 converter->FromV8Value(args[2], context()->v8_context()));
83 CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY)); 83 CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY));
84 params.reset( 84 params.reset(
85 static_cast<base::DictionaryValue*>(params_as_value.release())); 85 static_cast<base::DictionaryValue*>(params_as_value.release()));
86 } 86 }
87 87
88 // Add flag to |params| to indicate that the element size is specified in 88 // Add flag to |params| to indicate that the element size is specified in
89 // logical units. 89 // logical units.
90 params->SetBoolean(guestview::kElementSizeIsLogical, true); 90 params->SetBoolean(guest_view::kElementSizeIsLogical, true);
91 91
92 linked_ptr<ExtensionsGuestViewContainer::Request> request( 92 linked_ptr<ExtensionsGuestViewContainer::Request> request(
93 new ExtensionsGuestViewContainer::AttachRequest( 93 new ExtensionsGuestViewContainer::AttachRequest(
94 guest_view_container, guest_instance_id, params.Pass(), 94 guest_view_container, guest_instance_id, params.Pass(),
95 args.Length() == 4 ? args[3].As<v8::Function>() 95 args.Length() == 4 ? args[3].As<v8::Function>()
96 : v8::Local<v8::Function>(), 96 : v8::Local<v8::Function>(),
97 args.GetIsolate())); 97 args.GetIsolate()));
98 guest_view_container->IssueRequest(request); 98 guest_view_container->IssueRequest(request);
99 99
100 args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true)); 100 args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true));
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const v8::FunctionCallbackInfo<v8::Value>& args) { 204 const v8::FunctionCallbackInfo<v8::Value>& args) {
205 // Gesture is required to request fullscreen. 205 // Gesture is required to request fullscreen.
206 blink::WebScopedUserGesture user_gesture; 206 blink::WebScopedUserGesture user_gesture;
207 CHECK_EQ(args.Length(), 1); 207 CHECK_EQ(args.Length(), 1);
208 CHECK(args[0]->IsFunction()); 208 CHECK(args[0]->IsFunction());
209 v8::Local<v8::Value> no_args; 209 v8::Local<v8::Value> no_args;
210 context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args); 210 context()->CallFunction(v8::Local<v8::Function>::Cast(args[0]), 0, &no_args);
211 } 211 }
212 212
213 } // namespace extensions 213 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698