OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/renderer/guest_view/extensions_iframe_guest_view_request.h" |
| 6 |
| 7 #include "components/guest_view/renderer/guest_view_container.h" |
| 8 #include "content/public/renderer/render_frame.h" |
| 9 #include "extensions/common/guest_view/extensions_guest_view_messages.h" |
| 10 |
| 11 namespace extensions { |
| 12 |
| 13 GuestViewAttachIframeRequest::GuestViewAttachIframeRequest( |
| 14 guest_view::GuestViewContainer* container, |
| 15 int render_frame_routing_id, |
| 16 int guest_instance_id, |
| 17 scoped_ptr<base::DictionaryValue> params, |
| 18 v8::Local<v8::Function> callback, |
| 19 v8::Isolate* isolate) |
| 20 : GuestViewRequest(container, callback, isolate), |
| 21 render_frame_routing_id_(render_frame_routing_id), |
| 22 guest_instance_id_(guest_instance_id), |
| 23 params_(params.Pass()) { |
| 24 } |
| 25 |
| 26 GuestViewAttachIframeRequest::~GuestViewAttachIframeRequest() { |
| 27 } |
| 28 |
| 29 void GuestViewAttachIframeRequest::PerformRequest() { |
| 30 DCHECK(container()->render_frame()); |
| 31 |
| 32 container()->render_frame()->Send( |
| 33 new ExtensionsGuestViewHostMsg_AttachToEmbedderFrame( |
| 34 render_frame_routing_id_, container()->element_instance_id(), |
| 35 guest_instance_id_, *params_)); |
| 36 } |
| 37 |
| 38 void GuestViewAttachIframeRequest::HandleResponse(const IPC::Message& message) { |
| 39 ExtensionsGuestViewMsg_AttachToEmbedderFrame_ACK::Param param; |
| 40 bool message_read_status = |
| 41 ExtensionsGuestViewMsg_AttachToEmbedderFrame_ACK::Read(&message, ¶m); |
| 42 DCHECK(message_read_status); |
| 43 |
| 44 ExecuteCallbackIfAvailable(0, nullptr); |
| 45 } |
| 46 |
| 47 } // namespace extensions |
OLD | NEW |