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

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

Issue 972193003: Fix for MIME handler bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment. Created 5 years, 9 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
« no previous file with comments | « extensions/common/guest_view/guest_view_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/public/child/v8_value_converter.h" 10 #include "content/public/child/v8_value_converter.h"
11 #include "content/public/renderer/render_view.h" 11 #include "content/public/renderer/render_view.h"
12 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
13 #include "extensions/common/extension_messages.h" 13 #include "extensions/common/extension_messages.h"
14 #include "extensions/common/guest_view/guest_view_constants.h"
14 #include "extensions/renderer/guest_view/extensions_guest_view_container.h" 15 #include "extensions/renderer/guest_view/extensions_guest_view_container.h"
15 #include "extensions/renderer/script_context.h" 16 #include "extensions/renderer/script_context.h"
16 #include "v8/include/v8.h" 17 #include "v8/include/v8.h"
17 18
18 using content::V8ValueConverter; 19 using content::V8ValueConverter;
19 20
20 namespace extensions { 21 namespace extensions {
21 22
22 GuestViewInternalCustomBindings::GuestViewInternalCustomBindings( 23 GuestViewInternalCustomBindings::GuestViewInternalCustomBindings(
23 ScriptContext* context) 24 ScriptContext* context)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 scoped_ptr<base::DictionaryValue> params; 68 scoped_ptr<base::DictionaryValue> params;
68 { 69 {
69 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); 70 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
70 scoped_ptr<base::Value> params_as_value( 71 scoped_ptr<base::Value> params_as_value(
71 converter->FromV8Value(args[2], context()->v8_context())); 72 converter->FromV8Value(args[2], context()->v8_context()));
72 CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY)); 73 CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY));
73 params.reset( 74 params.reset(
74 static_cast<base::DictionaryValue*>(params_as_value.release())); 75 static_cast<base::DictionaryValue*>(params_as_value.release()));
75 } 76 }
76 77
78 // Add flag to |params| to indicate that the element size is specified in
79 // logical units.
80 params->SetBoolean(guestview::kElementSizeIsLogical, true);
81
77 linked_ptr<ExtensionsGuestViewContainer::Request> request( 82 linked_ptr<ExtensionsGuestViewContainer::Request> request(
78 new ExtensionsGuestViewContainer::AttachRequest( 83 new ExtensionsGuestViewContainer::AttachRequest(
79 guest_view_container, 84 guest_view_container,
80 guest_instance_id, 85 guest_instance_id,
81 params.Pass(), 86 params.Pass(),
82 args.Length() == 4 ? args[3].As<v8::Function>() : 87 args.Length() == 4 ? args[3].As<v8::Function>() :
83 v8::Handle<v8::Function>(), 88 v8::Handle<v8::Function>(),
84 args.GetIsolate())); 89 args.GetIsolate()));
85 guest_view_container->IssueRequest(request); 90 guest_view_container->IssueRequest(request);
86 91
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (!guest_view_container) 162 if (!guest_view_container)
158 return; 163 return;
159 164
160 guest_view_container->RegisterElementResizeCallback( 165 guest_view_container->RegisterElementResizeCallback(
161 args[1].As<v8::Function>(), args.GetIsolate()); 166 args[1].As<v8::Function>(), args.GetIsolate());
162 167
163 args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true)); 168 args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true));
164 } 169 }
165 170
166 } // namespace extensions 171 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/guest_view/guest_view_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698