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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 #include "content/public/common/three_d_api_types.h" | 69 #include "content/public/common/three_d_api_types.h" |
70 #include "content/public/common/url_constants.h" | 70 #include "content/public/common/url_constants.h" |
71 #include "content/public/common/web_preferences.h" | 71 #include "content/public/common/web_preferences.h" |
72 #include "content/public/renderer/content_renderer_client.h" | 72 #include "content/public/renderer/content_renderer_client.h" |
73 #include "content/public/renderer/document_state.h" | 73 #include "content/public/renderer/document_state.h" |
74 #include "content/public/renderer/navigation_state.h" | 74 #include "content/public/renderer/navigation_state.h" |
75 #include "content/public/renderer/render_view_observer.h" | 75 #include "content/public/renderer/render_view_observer.h" |
76 #include "content/public/renderer/render_view_visitor.h" | 76 #include "content/public/renderer/render_view_visitor.h" |
77 #include "content/renderer/browser_plugin/browser_plugin.h" | 77 #include "content/renderer/browser_plugin/browser_plugin.h" |
78 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 78 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
79 #include "content/renderer/disambiguation_popup_helper.h" | |
80 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 79 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
81 #include "content/renderer/drop_data_builder.h" | 80 #include "content/renderer/drop_data_builder.h" |
82 #include "content/renderer/gpu/render_widget_compositor.h" | 81 #include "content/renderer/gpu/render_widget_compositor.h" |
83 #include "content/renderer/history_controller.h" | 82 #include "content/renderer/history_controller.h" |
84 #include "content/renderer/history_serialization.h" | 83 #include "content/renderer/history_serialization.h" |
85 #include "content/renderer/idle_user_detector.h" | 84 #include "content/renderer/idle_user_detector.h" |
86 #include "content/renderer/ime_event_guard.h" | 85 #include "content/renderer/ime_event_guard.h" |
87 #include "content/renderer/input/input_handler_manager.h" | 86 #include "content/renderer/input/input_handler_manager.h" |
88 #include "content/renderer/internal_document_state_data.h" | 87 #include "content/renderer/internal_document_state_data.h" |
89 #include "content/renderer/media/audio_device_factory.h" | 88 #include "content/renderer/media/audio_device_factory.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 #include "ui/gfx/geometry/size_conversions.h" | 174 #include "ui/gfx/geometry/size_conversions.h" |
176 #include "ui/gfx/native_widget_types.h" | 175 #include "ui/gfx/native_widget_types.h" |
177 #include "url/url_constants.h" | 176 #include "url/url_constants.h" |
178 #include "v8/include/v8.h" | 177 #include "v8/include/v8.h" |
179 | 178 |
180 #if defined(OS_ANDROID) | 179 #if defined(OS_ANDROID) |
181 #include <cpu-features.h> | 180 #include <cpu-features.h> |
182 | 181 |
183 #include "content/renderer/android/address_detector.h" | 182 #include "content/renderer/android/address_detector.h" |
184 #include "content/renderer/android/content_detector.h" | 183 #include "content/renderer/android/content_detector.h" |
| 184 #include "content/renderer/android/disambiguation_popup_helper.h" |
185 #include "content/renderer/android/email_detector.h" | 185 #include "content/renderer/android/email_detector.h" |
186 #include "content/renderer/android/phone_number_detector.h" | 186 #include "content/renderer/android/phone_number_detector.h" |
187 #include "ui/gfx/geometry/rect_f.h" | 187 #include "ui/gfx/geometry/rect_f.h" |
188 | 188 |
189 #elif defined(OS_WIN) | 189 #elif defined(OS_WIN) |
190 // TODO(port): these files are currently Windows only because they concern: | 190 // TODO(port): these files are currently Windows only because they concern: |
191 // * theming | 191 // * theming |
192 #include "ui/native_theme/native_theme_win.h" | 192 #include "ui/native_theme/native_theme_win.h" |
193 #elif defined(USE_X11) | 193 #elif defined(USE_X11) |
194 #include "ui/native_theme/native_theme.h" | 194 #include "ui/native_theme/native_theme.h" |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 settings->setMaxTouchPoints(prefs.pointer_events_max_touch_points); | 1007 settings->setMaxTouchPoints(prefs.pointer_events_max_touch_points); |
1008 settings->setAvailablePointerTypes(prefs.available_pointer_types); | 1008 settings->setAvailablePointerTypes(prefs.available_pointer_types); |
1009 settings->setPrimaryPointerType( | 1009 settings->setPrimaryPointerType( |
1010 static_cast<blink::PointerType>(prefs.primary_pointer_type)); | 1010 static_cast<blink::PointerType>(prefs.primary_pointer_type)); |
1011 settings->setAvailableHoverTypes(prefs.available_hover_types); | 1011 settings->setAvailableHoverTypes(prefs.available_hover_types); |
1012 settings->setPrimaryHoverType( | 1012 settings->setPrimaryHoverType( |
1013 static_cast<blink::HoverType>(prefs.primary_hover_type)); | 1013 static_cast<blink::HoverType>(prefs.primary_hover_type)); |
1014 settings->setDeviceSupportsTouch(prefs.device_supports_touch); | 1014 settings->setDeviceSupportsTouch(prefs.device_supports_touch); |
1015 settings->setDeviceSupportsMouse(prefs.device_supports_mouse); | 1015 settings->setDeviceSupportsMouse(prefs.device_supports_mouse); |
1016 settings->setEnableTouchAdjustment(prefs.touch_adjustment_enabled); | 1016 settings->setEnableTouchAdjustment(prefs.touch_adjustment_enabled); |
1017 settings->setMultiTargetTapNotificationEnabled( | |
1018 switches::IsLinkDisambiguationPopupEnabled()); | |
1019 | 1017 |
1020 WebRuntimeFeatures::enableImageColorProfiles( | 1018 WebRuntimeFeatures::enableImageColorProfiles( |
1021 prefs.image_color_profiles_enabled); | 1019 prefs.image_color_profiles_enabled); |
1022 settings->setShouldRespectImageOrientation( | 1020 settings->setShouldRespectImageOrientation( |
1023 prefs.should_respect_image_orientation); | 1021 prefs.should_respect_image_orientation); |
1024 | 1022 |
1025 settings->setEditingBehavior( | 1023 settings->setEditingBehavior( |
1026 static_cast<WebSettings::EditingBehavior>(prefs.editing_behavior)); | 1024 static_cast<WebSettings::EditingBehavior>(prefs.editing_behavior)); |
1027 | 1025 |
1028 settings->setSupportsMultipleWindows(prefs.supports_multiple_windows); | 1026 settings->setSupportsMultipleWindows(prefs.supports_multiple_windows); |
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3234 void RenderViewImpl::OnShowContextMenu( | 3232 void RenderViewImpl::OnShowContextMenu( |
3235 ui::MenuSourceType source_type, const gfx::Point& location) { | 3233 ui::MenuSourceType source_type, const gfx::Point& location) { |
3236 input_handler_->set_context_menu_source_type(source_type); | 3234 input_handler_->set_context_menu_source_type(source_type); |
3237 has_host_context_menu_location_ = true; | 3235 has_host_context_menu_location_ = true; |
3238 host_context_menu_location_ = location; | 3236 host_context_menu_location_ = location; |
3239 if (webview()) | 3237 if (webview()) |
3240 webview()->showContextMenu(); | 3238 webview()->showContextMenu(); |
3241 has_host_context_menu_location_ = false; | 3239 has_host_context_menu_location_ = false; |
3242 } | 3240 } |
3243 | 3241 |
3244 #if defined(OS_ANDROID) || defined(USE_AURA) | 3242 #if defined(OS_ANDROID) |
3245 bool RenderViewImpl::didTapMultipleTargets( | 3243 bool RenderViewImpl::didTapMultipleTargets( |
3246 const WebSize& inner_viewport_offset, | 3244 const WebSize& inner_viewport_offset, |
3247 const WebRect& touch_rect, | 3245 const WebRect& touch_rect, |
3248 const WebVector<WebRect>& target_rects) { | 3246 const WebVector<WebRect>& target_rects) { |
3249 DCHECK(switches::IsLinkDisambiguationPopupEnabled()); | |
3250 | |
3251 // Never show a disambiguation popup when accessibility is enabled, | 3247 // Never show a disambiguation popup when accessibility is enabled, |
3252 // as this interferes with "touch exploration". | 3248 // as this interferes with "touch exploration". |
3253 AccessibilityMode accessibility_mode = | 3249 AccessibilityMode accessibility_mode = |
3254 GetMainRenderFrame()->accessibility_mode(); | 3250 GetMainRenderFrame()->accessibility_mode(); |
3255 bool matches_accessibility_mode_complete = | 3251 bool matches_accessibility_mode_complete = |
3256 (accessibility_mode & AccessibilityModeComplete) == | 3252 (accessibility_mode & AccessibilityModeComplete) == |
3257 AccessibilityModeComplete; | 3253 AccessibilityModeComplete; |
3258 if (matches_accessibility_mode_complete) | 3254 if (matches_accessibility_mode_complete) |
3259 return false; | 3255 return false; |
3260 | 3256 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3317 handled = true; | 3313 handled = true; |
3318 break; | 3314 break; |
3319 } | 3315 } |
3320 case TAP_MULTIPLE_TARGETS_STRATEGY_NONE: | 3316 case TAP_MULTIPLE_TARGETS_STRATEGY_NONE: |
3321 // No-op. | 3317 // No-op. |
3322 break; | 3318 break; |
3323 } | 3319 } |
3324 | 3320 |
3325 return handled; | 3321 return handled; |
3326 } | 3322 } |
3327 #endif // defined(OS_ANDROID) || defined(USE_AURA) | 3323 #endif // defined(OS_ANDROID) |
3328 | 3324 |
3329 unsigned RenderViewImpl::GetLocalSessionHistoryLengthForTesting() const { | 3325 unsigned RenderViewImpl::GetLocalSessionHistoryLengthForTesting() const { |
3330 return history_list_length_; | 3326 return history_list_length_; |
3331 } | 3327 } |
3332 | 3328 |
3333 void RenderViewImpl::SetFocusAndActivateForTesting(bool enable) { | 3329 void RenderViewImpl::SetFocusAndActivateForTesting(bool enable) { |
3334 if (enable) { | 3330 if (enable) { |
3335 if (has_focus()) | 3331 if (has_focus()) |
3336 return; | 3332 return; |
3337 OnSetActive(true); | 3333 OnSetActive(true); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3428 if (IsUseZoomForDSFEnabled()) { | 3424 if (IsUseZoomForDSFEnabled()) { |
3429 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3425 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3430 } else { | 3426 } else { |
3431 webview()->setDeviceScaleFactor(device_scale_factor_); | 3427 webview()->setDeviceScaleFactor(device_scale_factor_); |
3432 } | 3428 } |
3433 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3429 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3434 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3430 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3435 } | 3431 } |
3436 | 3432 |
3437 } // namespace content | 3433 } // namespace content |
OLD | NEW |