OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "content/public/browser/render_frame_host.h" | 65 #include "content/public/browser/render_frame_host.h" |
66 #include "content/public/browser/render_widget_host_iterator.h" | 66 #include "content/public/browser/render_widget_host_iterator.h" |
67 #include "content/public/browser/storage_partition.h" | 67 #include "content/public/browser/storage_partition.h" |
68 #include "content/public/browser/user_metrics.h" | 68 #include "content/public/browser/user_metrics.h" |
69 #include "content/public/common/bindings_policy.h" | 69 #include "content/public/common/bindings_policy.h" |
70 #include "content/public/common/content_constants.h" | 70 #include "content/public/common/content_constants.h" |
71 #include "content/public/common/content_switches.h" | 71 #include "content/public/common/content_switches.h" |
72 #include "content/public/common/context_menu_params.h" | 72 #include "content/public/common/context_menu_params.h" |
73 #include "content/public/common/drop_data.h" | 73 #include "content/public/common/drop_data.h" |
74 #include "content/public/common/result_codes.h" | 74 #include "content/public/common/result_codes.h" |
75 #include "content/public/common/url_constants.h" | |
76 #include "content/public/common/url_utils.h" | 75 #include "content/public/common/url_utils.h" |
77 #include "net/base/filename_util.h" | 76 #include "net/base/filename_util.h" |
78 #include "net/base/net_util.h" | 77 #include "net/base/net_util.h" |
79 #include "net/base/network_change_notifier.h" | 78 #include "net/base/network_change_notifier.h" |
80 #include "net/url_request/url_request_context_getter.h" | 79 #include "net/url_request/url_request_context_getter.h" |
81 #include "third_party/skia/include/core/SkBitmap.h" | 80 #include "third_party/skia/include/core/SkBitmap.h" |
82 #include "ui/accessibility/ax_tree.h" | 81 #include "ui/accessibility/ax_tree.h" |
83 #include "ui/base/touch/touch_device.h" | 82 #include "ui/base/touch/touch_device.h" |
84 #include "ui/base/touch/touch_enabled.h" | 83 #include "ui/base/touch/touch_enabled.h" |
85 #include "ui/base/ui_base_switches.h" | 84 #include "ui/base/ui_base_switches.h" |
86 #include "ui/gfx/image/image_skia.h" | 85 #include "ui/gfx/image/image_skia.h" |
87 #include "ui/gfx/native_widget_types.h" | 86 #include "ui/gfx/native_widget_types.h" |
88 #include "ui/native_theme/native_theme_switches.h" | 87 #include "ui/native_theme/native_theme_switches.h" |
89 #include "ui/shell_dialogs/selected_file_info.h" | 88 #include "ui/shell_dialogs/selected_file_info.h" |
| 89 #include "url/url_constants.h" |
90 #include "webkit/browser/fileapi/isolated_context.h" | 90 #include "webkit/browser/fileapi/isolated_context.h" |
91 | 91 |
92 #if defined(OS_MACOSX) | 92 #if defined(OS_MACOSX) |
93 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 93 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
94 #elif defined(OS_ANDROID) | 94 #elif defined(OS_ANDROID) |
95 #include "content/browser/media/android/media_web_contents_observer.h" | 95 #include "content/browser/media/android/media_web_contents_observer.h" |
96 #elif defined(OS_WIN) | 96 #elif defined(OS_WIN) |
97 #include "base/win/win_util.h" | 97 #include "base/win/win_util.h" |
98 #endif | 98 #endif |
99 | 99 |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | 1248 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
1249 if (!view) | 1249 if (!view) |
1250 return; | 1250 return; |
1251 | 1251 |
1252 DropData filtered_data(drop_data); | 1252 DropData filtered_data(drop_data); |
1253 RenderProcessHost* process = GetProcess(); | 1253 RenderProcessHost* process = GetProcess(); |
1254 ChildProcessSecurityPolicyImpl* policy = | 1254 ChildProcessSecurityPolicyImpl* policy = |
1255 ChildProcessSecurityPolicyImpl::GetInstance(); | 1255 ChildProcessSecurityPolicyImpl::GetInstance(); |
1256 | 1256 |
1257 // Allow drag of Javascript URLs to enable bookmarklet drag to bookmark bar. | 1257 // Allow drag of Javascript URLs to enable bookmarklet drag to bookmark bar. |
1258 if (!filtered_data.url.SchemeIs(kJavaScriptScheme)) | 1258 if (!filtered_data.url.SchemeIs(url::kJavaScriptScheme)) |
1259 process->FilterURL(true, &filtered_data.url); | 1259 process->FilterURL(true, &filtered_data.url); |
1260 process->FilterURL(false, &filtered_data.html_base_url); | 1260 process->FilterURL(false, &filtered_data.html_base_url); |
1261 // Filter out any paths that the renderer didn't have access to. This prevents | 1261 // Filter out any paths that the renderer didn't have access to. This prevents |
1262 // the following attack on a malicious renderer: | 1262 // the following attack on a malicious renderer: |
1263 // 1. StartDragging IPC sent with renderer-specified filesystem paths that it | 1263 // 1. StartDragging IPC sent with renderer-specified filesystem paths that it |
1264 // doesn't have read permissions for. | 1264 // doesn't have read permissions for. |
1265 // 2. We initiate a native DnD operation. | 1265 // 2. We initiate a native DnD operation. |
1266 // 3. DnD operation immediately ends since mouse is not held down. DnD events | 1266 // 3. DnD operation immediately ends since mouse is not held down. DnD events |
1267 // still fire though, which causes read permissions to be granted to the | 1267 // still fire though, which causes read permissions to be granted to the |
1268 // renderer for any file paths in the drop. | 1268 // renderer for any file paths in the drop. |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1683 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1684 | 1684 |
1685 frame_tree->ResetForMainFrameSwap(); | 1685 frame_tree->ResetForMainFrameSwap(); |
1686 } | 1686 } |
1687 | 1687 |
1688 void RenderViewHostImpl::SelectWordAroundCaret() { | 1688 void RenderViewHostImpl::SelectWordAroundCaret() { |
1689 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1689 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1690 } | 1690 } |
1691 | 1691 |
1692 } // namespace content | 1692 } // namespace content |
OLD | NEW |