| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 } | 979 } |
| 980 | 980 |
| 981 void RenderViewHost::OnMsgDidDownloadImage( | 981 void RenderViewHost::OnMsgDidDownloadImage( |
| 982 int id, | 982 int id, |
| 983 const GURL& image_url, | 983 const GURL& image_url, |
| 984 bool errored, | 984 bool errored, |
| 985 const SkBitmap& image) { | 985 const SkBitmap& image) { |
| 986 delegate_->DidDownloadImage(this, id, image_url, errored, image); | 986 delegate_->DidDownloadImage(this, id, image_url, errored, image); |
| 987 } | 987 } |
| 988 | 988 |
| 989 void RenderViewHost::OnMsgContextMenu( | 989 void RenderViewHost::OnMsgContextMenu(const ContextMenuParams& params) { |
| 990 const ViewHostMsg_ContextMenu_Params& params) { | |
| 991 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 990 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 992 if (!view) | 991 if (!view) |
| 993 return; | 992 return; |
| 994 | 993 |
| 995 // Validate the URLs in |params|. If the renderer can't request the URLs | 994 // Validate the URLs in |params|. If the renderer can't request the URLs |
| 996 // directly, don't show them in the context menu. | 995 // directly, don't show them in the context menu. |
| 997 ViewHostMsg_ContextMenu_Params validated_params(params); | 996 ContextMenuParams validated_params(params); |
| 998 const int renderer_id = process()->host_id(); | 997 const int renderer_id = process()->host_id(); |
| 999 RendererSecurityPolicy* policy = RendererSecurityPolicy::GetInstance(); | 998 RendererSecurityPolicy* policy = RendererSecurityPolicy::GetInstance(); |
| 1000 | 999 |
| 1001 FilterURL(policy, renderer_id, &validated_params.link_url); | 1000 FilterURL(policy, renderer_id, &validated_params.link_url); |
| 1002 FilterURL(policy, renderer_id, &validated_params.image_url); | 1001 FilterURL(policy, renderer_id, &validated_params.image_url); |
| 1003 FilterURL(policy, renderer_id, &validated_params.page_url); | 1002 FilterURL(policy, renderer_id, &validated_params.page_url); |
| 1004 FilterURL(policy, renderer_id, &validated_params.frame_url); | 1003 FilterURL(policy, renderer_id, &validated_params.frame_url); |
| 1005 | 1004 |
| 1006 view->ShowContextMenu(validated_params); | 1005 view->ShowContextMenu(validated_params); |
| 1007 } | 1006 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 std::string event_arg) { | 1285 std::string event_arg) { |
| 1287 Send(new ViewMsg_PersonalizationEvent(routing_id(), event_name, event_arg)); | 1286 Send(new ViewMsg_PersonalizationEvent(routing_id(), event_name, event_arg)); |
| 1288 } | 1287 } |
| 1289 #endif | 1288 #endif |
| 1290 | 1289 |
| 1291 void RenderViewHost::ForwardMessageFromExternalHost( | 1290 void RenderViewHost::ForwardMessageFromExternalHost( |
| 1292 const std::string& target, const std::string& message) { | 1291 const std::string& target, const std::string& message) { |
| 1293 Send(new ViewMsg_HandleMessageFromExternalHost(routing_id(), target, | 1292 Send(new ViewMsg_HandleMessageFromExternalHost(routing_id(), target, |
| 1294 message)); | 1293 message)); |
| 1295 } | 1294 } |
| OLD | NEW |