| 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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 1041 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 1042 if (!view) | 1042 if (!view) |
| 1043 return; | 1043 return; |
| 1044 | 1044 |
| 1045 // Validate the URLs in |params|. If the renderer can't request the URLs | 1045 // Validate the URLs in |params|. If the renderer can't request the URLs |
| 1046 // directly, don't show them in the context menu. | 1046 // directly, don't show them in the context menu. |
| 1047 ContextMenuParams validated_params(params); | 1047 ContextMenuParams validated_params(params); |
| 1048 const int renderer_id = process()->pid(); | 1048 const int renderer_id = process()->pid(); |
| 1049 RendererSecurityPolicy* policy = RendererSecurityPolicy::GetInstance(); | 1049 RendererSecurityPolicy* policy = RendererSecurityPolicy::GetInstance(); |
| 1050 | 1050 |
| 1051 // We don't validate |unfiltered_link_url| so that this field can be used |
| 1052 // when users want to copy the original link URL. |
| 1051 FilterURL(policy, renderer_id, &validated_params.link_url); | 1053 FilterURL(policy, renderer_id, &validated_params.link_url); |
| 1052 FilterURL(policy, renderer_id, &validated_params.image_url); | 1054 FilterURL(policy, renderer_id, &validated_params.image_url); |
| 1053 FilterURL(policy, renderer_id, &validated_params.page_url); | 1055 FilterURL(policy, renderer_id, &validated_params.page_url); |
| 1054 FilterURL(policy, renderer_id, &validated_params.frame_url); | 1056 FilterURL(policy, renderer_id, &validated_params.frame_url); |
| 1055 | 1057 |
| 1056 view->ShowContextMenu(validated_params); | 1058 view->ShowContextMenu(validated_params); |
| 1057 } | 1059 } |
| 1058 | 1060 |
| 1059 void RenderViewHost::OnMsgOpenURL(const GURL& url, | 1061 void RenderViewHost::OnMsgOpenURL(const GURL& url, |
| 1060 const GURL& referrer, | 1062 const GURL& referrer, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 int callback_id) { | 1389 int callback_id) { |
| 1388 // TODO(aa): Here is where we can check that this renderer was supposed to be | 1390 // TODO(aa): Here is where we can check that this renderer was supposed to be |
| 1389 // able to call extension APIs. | 1391 // able to call extension APIs. |
| 1390 extension_function_dispatcher_.HandleRequest(name, args, callback_id); | 1392 extension_function_dispatcher_.HandleRequest(name, args, callback_id); |
| 1391 } | 1393 } |
| 1392 | 1394 |
| 1393 void RenderViewHost::SendExtensionResponse(int callback_id, | 1395 void RenderViewHost::SendExtensionResponse(int callback_id, |
| 1394 const std::string& response) { | 1396 const std::string& response) { |
| 1395 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); | 1397 Send(new ViewMsg_ExtensionResponse(routing_id(), callback_id, response)); |
| 1396 } | 1398 } |
| OLD | NEW |