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_container.h" | 5 #include "extensions/renderer/guest_view/guest_view_container.h" |
6 | 6 |
7 #include "content/public/renderer/browser_plugin_delegate.h" | 7 #include "content/public/renderer/browser_plugin_delegate.h" |
8 #include "content/public/renderer/render_frame.h" | 8 #include "content/public/renderer/render_frame.h" |
9 #include "content/public/renderer/render_view.h" | 9 #include "content/public/renderer/render_view.h" |
10 #include "extensions/common/extension_messages.h" | 10 #include "extensions/common/extension_messages.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 int element_instance_id) { | 141 int element_instance_id) { |
142 DCHECK_NE(element_instance_id_, guestview::kInstanceIDNone); | 142 DCHECK_NE(element_instance_id_, guestview::kInstanceIDNone); |
143 DCHECK_EQ(element_instance_id_, element_instance_id); | 143 DCHECK_EQ(element_instance_id_, element_instance_id); |
144 DCHECK(!mime_type_.empty()); | 144 DCHECK(!mime_type_.empty()); |
145 render_frame()->AttachGuest(element_instance_id); | 145 render_frame()->AttachGuest(element_instance_id); |
146 } | 146 } |
147 | 147 |
148 void GuestViewContainer::OnGuestAttached(int element_instance_id, | 148 void GuestViewContainer::OnGuestAttached(int element_instance_id, |
149 int guest_proxy_routing_id) { | 149 int guest_proxy_routing_id) { |
150 attached_ = true; | 150 attached_ = true; |
| 151 |
| 152 if (!mime_type_.empty()) { |
| 153 // MimeHandlerView's creation and attachment is not done via JS API. |
| 154 return; |
| 155 } |
| 156 |
151 // Handle the callback for the current request with a pending response. | 157 // Handle the callback for the current request with a pending response. |
152 HandlePendingResponseCallback(guest_proxy_routing_id); | 158 HandlePendingResponseCallback(guest_proxy_routing_id); |
153 // Perform the subsequent attach request if one exists. | 159 // Perform the subsequent attach request if one exists. |
154 PerformPendingAttachRequest(); | 160 PerformPendingAttachRequest(); |
155 } | 161 } |
156 | 162 |
157 void GuestViewContainer::AttachGuestInternal( | 163 void GuestViewContainer::AttachGuestInternal( |
158 linked_ptr<AttachRequest> request) { | 164 linked_ptr<AttachRequest> request) { |
159 CHECK(!pending_response_.get()); | 165 CHECK(!pending_response_.get()); |
160 // Step 1, send the attach params to chrome/. | 166 // Step 1, send the attach params to chrome/. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 case ExtensionMsg_CreateMimeHandlerViewGuestACK::ID: | 231 case ExtensionMsg_CreateMimeHandlerViewGuestACK::ID: |
226 case ExtensionMsg_GuestAttached::ID: | 232 case ExtensionMsg_GuestAttached::ID: |
227 return true; | 233 return true; |
228 default: | 234 default: |
229 break; | 235 break; |
230 } | 236 } |
231 return false; | 237 return false; |
232 } | 238 } |
233 | 239 |
234 } // namespace extensions | 240 } // namespace extensions |
OLD | NEW |