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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 scoped_ptr<base::DictionaryValue> params; | 57 scoped_ptr<base::DictionaryValue> params; |
58 { | 58 { |
59 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); | 59 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); |
60 scoped_ptr<base::Value> params_as_value( | 60 scoped_ptr<base::Value> params_as_value( |
61 converter->FromV8Value(args[2], context()->v8_context())); | 61 converter->FromV8Value(args[2], context()->v8_context())); |
62 CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY)); | 62 CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY)); |
63 params.reset( | 63 params.reset( |
64 static_cast<base::DictionaryValue*>(params_as_value.release())); | 64 static_cast<base::DictionaryValue*>(params_as_value.release())); |
65 } | 65 } |
66 | 66 |
67 guest_view_container->AttachGuest( | 67 linked_ptr<GuestViewContainer::AttachRequest> request( |
68 element_instance_id, | 68 new GuestViewContainer::AttachRequest( |
69 guest_instance_id, | 69 element_instance_id, |
70 params.Pass(), | 70 guest_instance_id, |
71 args.Length() == 4 ? args[3].As<v8::Function>() : | 71 params.Pass(), |
72 v8::Handle<v8::Function>(), | 72 args.Length() == 4 ? args[3].As<v8::Function>() : |
73 args.GetIsolate()); | 73 v8::Handle<v8::Function>(), |
| 74 args.GetIsolate())); |
| 75 guest_view_container->AttachGuest(request); |
74 | 76 |
75 args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true)); | 77 args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true)); |
76 } | 78 } |
77 | 79 |
78 } // namespace extensions | 80 } // namespace extensions |
OLD | NEW |