| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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()); | 163 DCHECK(view()); |
| 164 | 164 |
| 165 ModalDialogEvent modal_dialog_event; | 165 ModalDialogEvent modal_dialog_event; |
| 166 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
| 167 modal_dialog_event.event = modal_dialog_event_handle; | 167 modal_dialog_event.event = modal_dialog_event_handle; |
| 168 #endif | 168 #endif |
| 169 | 169 |
| 170 Send(new ViewMsg_New(gfx::IdFromNativeView(view()->GetPluginNativeView()), | 170 gfx::NativeViewId view_id = |
| 171 gfx::IdFromNativeView(view()->GetPluginNativeView()); |
| 172 RendererSecurityPolicy::GetInstance()->GrantNativeViewId( |
| 173 process()->pid(), view_id); |
| 174 Send(new ViewMsg_New(view_id, |
| 171 modal_dialog_event, | 175 modal_dialog_event, |
| 172 delegate_->GetWebkitPrefs(), | 176 delegate_->GetWebkitPrefs(), |
| 173 routing_id())); | 177 routing_id())); |
| 174 | 178 |
| 175 // Set the alternate error page, which is profile specific, in the renderer. | 179 // Set the alternate error page, which is profile specific, in the renderer. |
| 176 GURL url = delegate_->GetAlternateErrorPageURL(); | 180 GURL url = delegate_->GetAlternateErrorPageURL(); |
| 177 SetAlternateErrorPageURL(url); | 181 SetAlternateErrorPageURL(url); |
| 178 | 182 |
| 179 // If it's enabled, tell the renderer to set up the Javascript bindings for | 183 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| 180 // sending messages back to the browser. | 184 // 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 | 1367 // TODO(aa): Here is where we can check that this renderer was supposed to be |
| 1364 // able to call extension APIs. | 1368 // able to call extension APIs. |
| 1365 DCHECK(extension_function_dispatcher_.get()); | 1369 DCHECK(extension_function_dispatcher_.get()); |
| 1366 extension_function_dispatcher_->HandleRequest(name, args, callback_id); | 1370 extension_function_dispatcher_->HandleRequest(name, args, callback_id); |
| 1367 } | 1371 } |
| 1368 | 1372 |
| 1369 void RenderViewHost::SendExtensionResponse(int callback_id, | 1373 void RenderViewHost::SendExtensionResponse(int callback_id, |
| 1370 const std::string& response) { | 1374 const std::string& response) { |
| 1371 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); | 1375 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); |
| 1372 } | 1376 } |
| OLD | NEW |