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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 #include "webkit/child/weburlresponse_extradata_impl.h" | 197 #include "webkit/child/weburlresponse_extradata_impl.h" |
198 | 198 |
199 #if defined(OS_ANDROID) | 199 #if defined(OS_ANDROID) |
200 #include <cpu-features.h> | 200 #include <cpu-features.h> |
201 | 201 |
202 #include "content/renderer/android/address_detector.h" | 202 #include "content/renderer/android/address_detector.h" |
203 #include "content/renderer/android/content_detector.h" | 203 #include "content/renderer/android/content_detector.h" |
204 #include "content/renderer/android/email_detector.h" | 204 #include "content/renderer/android/email_detector.h" |
205 #include "content/renderer/android/phone_number_detector.h" | 205 #include "content/renderer/android/phone_number_detector.h" |
206 #include "net/android/network_library.h" | 206 #include "net/android/network_library.h" |
207 #include "skia/ext/platform_canvas.h" | |
208 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 207 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
209 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 208 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
210 #include "third_party/WebKit/public/web/WebHitTestResult.h" | 209 #include "third_party/WebKit/public/web/WebHitTestResult.h" |
211 #include "ui/gfx/rect_f.h" | 210 #include "ui/gfx/rect_f.h" |
212 | 211 |
213 #elif defined(OS_WIN) | 212 #elif defined(OS_WIN) |
214 // TODO(port): these files are currently Windows only because they concern: | 213 // TODO(port): these files are currently Windows only because they concern: |
215 // * theming | 214 // * theming |
216 #include "ui/native_theme/native_theme_win.h" | 215 #include "ui/native_theme/native_theme_win.h" |
217 #elif defined(USE_X11) | 216 #elif defined(USE_X11) |
218 #include "ui/native_theme/native_theme.h" | 217 #include "ui/native_theme/native_theme.h" |
219 #elif defined(OS_MACOSX) | 218 #elif defined(OS_MACOSX) |
220 #include "skia/ext/skia_utils_mac.h" | 219 #include "skia/ext/skia_utils_mac.h" |
221 #endif | 220 #endif |
222 | 221 |
| 222 // Support for link disambiguation popup. |
| 223 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 224 #include "skia/ext/platform_canvas.h" |
| 225 #endif |
| 226 |
223 #if defined(ENABLE_PLUGINS) | 227 #if defined(ENABLE_PLUGINS) |
224 #include "content/renderer/npapi/webplugin_delegate_proxy.h" | 228 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
225 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 229 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
226 #include "content/renderer/pepper/pepper_plugin_registry.h" | 230 #include "content/renderer/pepper/pepper_plugin_registry.h" |
227 #endif | 231 #endif |
228 | 232 |
229 #if defined(ENABLE_WEBRTC) | 233 #if defined(ENABLE_WEBRTC) |
230 #include "content/renderer/media/rtc_peer_connection_handler.h" | 234 #include "content/renderer/media/rtc_peer_connection_handler.h" |
231 #endif | 235 #endif |
232 | 236 |
(...skipping 3878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4111 | 4115 |
4112 void RenderViewImpl::OnDisownOpener() { | 4116 void RenderViewImpl::OnDisownOpener() { |
4113 if (!webview()) | 4117 if (!webview()) |
4114 return; | 4118 return; |
4115 | 4119 |
4116 WebFrame* main_frame = webview()->mainFrame(); | 4120 WebFrame* main_frame = webview()->mainFrame(); |
4117 if (main_frame && main_frame->opener()) | 4121 if (main_frame && main_frame->opener()) |
4118 main_frame->setOpener(NULL); | 4122 main_frame->setOpener(NULL); |
4119 } | 4123 } |
4120 | 4124 |
4121 #if defined(OS_ANDROID) | 4125 #if defined(OS_ANDROID) || defined(OS_WIN) |
4122 bool RenderViewImpl::didTapMultipleTargets( | 4126 bool RenderViewImpl::didTapMultipleTargets( |
4123 const blink::WebGestureEvent& event, | 4127 const blink::WebGestureEvent& event, |
4124 const WebVector<WebRect>& target_rects) { | 4128 const WebVector<WebRect>& target_rects) { |
4125 // Never show a disambiguation popup when accessibility is enabled, | 4129 // Never show a disambiguation popup when accessibility is enabled, |
4126 // as this interferes with "touch exploration". | 4130 // as this interferes with "touch exploration". |
4127 AccessibilityMode accessibility_mode = | 4131 AccessibilityMode accessibility_mode = |
4128 main_render_frame()->accessibility_mode(); | 4132 main_render_frame()->accessibility_mode(); |
4129 bool matches_accessibility_mode_complete = | 4133 bool matches_accessibility_mode_complete = |
4130 (accessibility_mode & AccessibilityModeComplete) == | 4134 (accessibility_mode & AccessibilityModeComplete) == |
4131 AccessibilityModeComplete; | 4135 AccessibilityModeComplete; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4189 handled = true; | 4193 handled = true; |
4190 break; | 4194 break; |
4191 } | 4195 } |
4192 case TAP_MULTIPLE_TARGETS_STRATEGY_NONE: | 4196 case TAP_MULTIPLE_TARGETS_STRATEGY_NONE: |
4193 // No-op. | 4197 // No-op. |
4194 break; | 4198 break; |
4195 } | 4199 } |
4196 | 4200 |
4197 return handled; | 4201 return handled; |
4198 } | 4202 } |
4199 #endif | 4203 #endif // defined(OS_ANDROID) || defined(OS_WIN) |
4200 | 4204 |
4201 unsigned RenderViewImpl::GetLocalSessionHistoryLengthForTesting() const { | 4205 unsigned RenderViewImpl::GetLocalSessionHistoryLengthForTesting() const { |
4202 return history_list_length_; | 4206 return history_list_length_; |
4203 } | 4207 } |
4204 | 4208 |
4205 void RenderViewImpl::SetFocusAndActivateForTesting(bool enable) { | 4209 void RenderViewImpl::SetFocusAndActivateForTesting(bool enable) { |
4206 if (enable) { | 4210 if (enable) { |
4207 if (has_focus()) | 4211 if (has_focus()) |
4208 return; | 4212 return; |
4209 OnSetActive(true); | 4213 OnSetActive(true); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4287 std::vector<gfx::Size> sizes; | 4291 std::vector<gfx::Size> sizes; |
4288 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4292 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4289 if (!url.isEmpty()) | 4293 if (!url.isEmpty()) |
4290 urls.push_back( | 4294 urls.push_back( |
4291 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4295 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4292 } | 4296 } |
4293 SendUpdateFaviconURL(urls); | 4297 SendUpdateFaviconURL(urls); |
4294 } | 4298 } |
4295 | 4299 |
4296 } // namespace content | 4300 } // namespace content |
OLD | NEW |