| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 modal_dialog_event_->handle(), | 153 modal_dialog_event_->handle(), |
| 154 renderer_process_handle, | 154 renderer_process_handle, |
| 155 &modal_dialog_event_handle, | 155 &modal_dialog_event_handle, |
| 156 SYNCHRONIZE, | 156 SYNCHRONIZE, |
| 157 FALSE, | 157 FALSE, |
| 158 0); | 158 0); |
| 159 DCHECK(result) << | 159 DCHECK(result) << |
| 160 "Couldn't duplicate the modal dialog handle for the renderer."; | 160 "Couldn't duplicate the modal dialog handle for the renderer."; |
| 161 #endif | 161 #endif |
| 162 | 162 |
| 163 DCHECK(view()); | |
| 164 | |
| 165 ModalDialogEvent modal_dialog_event; | 163 ModalDialogEvent modal_dialog_event; |
| 166 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
| 167 modal_dialog_event.event = modal_dialog_event_handle; | 165 modal_dialog_event.event = modal_dialog_event_handle; |
| 168 #endif | 166 #endif |
| 169 | 167 |
| 170 Send(new ViewMsg_New(gfx::IdFromNativeView(view()->GetPluginNativeView()), | 168 Send(new ViewMsg_New(GetPluginNativeViewId(), |
| 171 modal_dialog_event, | 169 modal_dialog_event, |
| 172 delegate_->GetWebkitPrefs(), | 170 delegate_->GetWebkitPrefs(), |
| 173 routing_id())); | 171 routing_id())); |
| 174 | 172 |
| 175 // Set the alternate error page, which is profile specific, in the renderer. | 173 // Set the alternate error page, which is profile specific, in the renderer. |
| 176 GURL url = delegate_->GetAlternateErrorPageURL(); | 174 GURL url = delegate_->GetAlternateErrorPageURL(); |
| 177 SetAlternateErrorPageURL(url); | 175 SetAlternateErrorPageURL(url); |
| 178 | 176 |
| 179 // If it's enabled, tell the renderer to set up the Javascript bindings for | 177 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| 180 // sending messages back to the browser. | 178 // sending messages back to the browser. |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 // TODO(aa): Here is where we can check that this renderer was supposed to be | 1361 // TODO(aa): Here is where we can check that this renderer was supposed to be |
| 1364 // able to call extension APIs. | 1362 // able to call extension APIs. |
| 1365 DCHECK(extension_function_dispatcher_.get()); | 1363 DCHECK(extension_function_dispatcher_.get()); |
| 1366 extension_function_dispatcher_->HandleRequest(name, args, callback_id); | 1364 extension_function_dispatcher_->HandleRequest(name, args, callback_id); |
| 1367 } | 1365 } |
| 1368 | 1366 |
| 1369 void RenderViewHost::SendExtensionResponse(int callback_id, | 1367 void RenderViewHost::SendExtensionResponse(int callback_id, |
| 1370 const std::string& response) { | 1368 const std::string& response) { |
| 1371 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); | 1369 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); |
| 1372 } | 1370 } |
| OLD | NEW |