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/browser/guest_view/mime_handler_view/mime_handler_view_gues
t.h" | 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues
t.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 bool MimeHandlerViewGuest::SaveFrame(const GURL& url, | 196 bool MimeHandlerViewGuest::SaveFrame(const GURL& url, |
197 const content::Referrer& referrer) { | 197 const content::Referrer& referrer) { |
198 if (!attached()) | 198 if (!attached()) |
199 return false; | 199 return false; |
200 | 200 |
201 embedder_web_contents()->SaveFrame(content_url_, referrer); | 201 embedder_web_contents()->SaveFrame(content_url_, referrer); |
202 return true; | 202 return true; |
203 } | 203 } |
204 | 204 |
| 205 void MimeHandlerViewGuest::DocumentOnLoadCompletedInMainFrame() { |
| 206 embedder_web_contents()->Send( |
| 207 new ExtensionMsg_MimeHandlerViewGuestOnLoadCompleted( |
| 208 element_instance_id())); |
| 209 } |
| 210 |
205 bool MimeHandlerViewGuest::OnMessageReceived(const IPC::Message& message) { | 211 bool MimeHandlerViewGuest::OnMessageReceived(const IPC::Message& message) { |
206 bool handled = true; | 212 bool handled = true; |
207 IPC_BEGIN_MESSAGE_MAP(MimeHandlerViewGuest, message) | 213 IPC_BEGIN_MESSAGE_MAP(MimeHandlerViewGuest, message) |
208 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 214 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
209 IPC_MESSAGE_UNHANDLED(handled = false) | 215 IPC_MESSAGE_UNHANDLED(handled = false) |
210 IPC_END_MESSAGE_MAP() | 216 IPC_END_MESSAGE_MAP() |
211 return handled; | 217 return handled; |
212 } | 218 } |
213 | 219 |
214 void MimeHandlerViewGuest::OnRequest( | 220 void MimeHandlerViewGuest::OnRequest( |
215 const ExtensionHostMsg_Request_Params& params) { | 221 const ExtensionHostMsg_Request_Params& params) { |
216 if (extension_function_dispatcher_) { | 222 if (extension_function_dispatcher_) { |
217 extension_function_dispatcher_->Dispatch( | 223 extension_function_dispatcher_->Dispatch( |
218 params, web_contents()->GetRenderViewHost()); | 224 params, web_contents()->GetRenderViewHost()); |
219 } | 225 } |
220 } | 226 } |
221 | 227 |
222 } // namespace extensions | 228 } // namespace extensions |
OLD | NEW |