| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "content/public/common/ssl_status.h" | 60 #include "content/public/common/ssl_status.h" |
| 61 #include "content/public/common/three_d_api_types.h" | 61 #include "content/public/common/three_d_api_types.h" |
| 62 #include "content/public/common/url_constants.h" | 62 #include "content/public/common/url_constants.h" |
| 63 #include "content/public/common/url_utils.h" | 63 #include "content/public/common/url_utils.h" |
| 64 #include "content/public/renderer/content_renderer_client.h" | 64 #include "content/public/renderer/content_renderer_client.h" |
| 65 #include "content/public/renderer/document_state.h" | 65 #include "content/public/renderer/document_state.h" |
| 66 #include "content/public/renderer/navigation_state.h" | 66 #include "content/public/renderer/navigation_state.h" |
| 67 #include "content/public/renderer/render_view_observer.h" | 67 #include "content/public/renderer/render_view_observer.h" |
| 68 #include "content/public/renderer/render_view_visitor.h" | 68 #include "content/public/renderer/render_view_visitor.h" |
| 69 #include "content/public/renderer/web_preferences.h" | 69 #include "content/public/renderer/web_preferences.h" |
| 70 #include "content/renderer/accessibility/renderer_accessibility.h" | |
| 71 #include "content/renderer/accessibility/renderer_accessibility_complete.h" | |
| 72 #include "content/renderer/accessibility/renderer_accessibility_focus_only.h" | |
| 73 #include "content/renderer/browser_plugin/browser_plugin.h" | 70 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 74 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 71 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
| 75 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | 72 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
| 76 #include "content/renderer/devtools/devtools_agent.h" | 73 #include "content/renderer/devtools/devtools_agent.h" |
| 77 #include "content/renderer/disambiguation_popup_helper.h" | 74 #include "content/renderer/disambiguation_popup_helper.h" |
| 78 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 75 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 79 #include "content/renderer/drop_data_builder.h" | 76 #include "content/renderer/drop_data_builder.h" |
| 80 #include "content/renderer/external_popup_menu.h" | 77 #include "content/renderer/external_popup_menu.h" |
| 81 #include "content/renderer/geolocation_dispatcher.h" | 78 #include "content/renderer/geolocation_dispatcher.h" |
| 82 #include "content/renderer/gpu/render_widget_compositor.h" | 79 #include "content/renderer/gpu/render_widget_compositor.h" |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 cached_is_main_frame_pinned_to_left_(false), | 647 cached_is_main_frame_pinned_to_left_(false), |
| 651 cached_is_main_frame_pinned_to_right_(false), | 648 cached_is_main_frame_pinned_to_right_(false), |
| 652 has_scrolled_focused_editable_node_into_rect_(false), | 649 has_scrolled_focused_editable_node_into_rect_(false), |
| 653 push_messaging_dispatcher_(NULL), | 650 push_messaging_dispatcher_(NULL), |
| 654 geolocation_dispatcher_(NULL), | 651 geolocation_dispatcher_(NULL), |
| 655 speech_recognition_dispatcher_(NULL), | 652 speech_recognition_dispatcher_(NULL), |
| 656 media_stream_dispatcher_(NULL), | 653 media_stream_dispatcher_(NULL), |
| 657 browser_plugin_manager_(NULL), | 654 browser_plugin_manager_(NULL), |
| 658 midi_dispatcher_(NULL), | 655 midi_dispatcher_(NULL), |
| 659 devtools_agent_(NULL), | 656 devtools_agent_(NULL), |
| 660 accessibility_mode_(AccessibilityModeOff), | |
| 661 renderer_accessibility_(NULL), | |
| 662 mouse_lock_dispatcher_(NULL), | 657 mouse_lock_dispatcher_(NULL), |
| 663 #if defined(OS_ANDROID) | 658 #if defined(OS_ANDROID) |
| 664 expected_content_intent_id_(0), | 659 expected_content_intent_id_(0), |
| 665 media_player_manager_(NULL), | 660 media_player_manager_(NULL), |
| 666 #endif | 661 #endif |
| 667 #if defined(OS_WIN) | 662 #if defined(OS_WIN) |
| 668 focused_plugin_id_(-1), | 663 focused_plugin_id_(-1), |
| 669 #endif | 664 #endif |
| 670 #if defined(ENABLE_PLUGINS) | 665 #if defined(ENABLE_PLUGINS) |
| 671 plugin_find_handler_(NULL), | 666 plugin_find_handler_(NULL), |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 // The next group of objects all implement RenderViewObserver, so are deleted | 792 // The next group of objects all implement RenderViewObserver, so are deleted |
| 798 // along with the RenderView automatically. | 793 // along with the RenderView automatically. |
| 799 devtools_agent_ = new DevToolsAgent(this); | 794 devtools_agent_ = new DevToolsAgent(this); |
| 800 if (RenderWidgetCompositor* rwc = compositor()) { | 795 if (RenderWidgetCompositor* rwc = compositor()) { |
| 801 webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId()); | 796 webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId()); |
| 802 } | 797 } |
| 803 mouse_lock_dispatcher_ = new RenderViewMouseLockDispatcher(this); | 798 mouse_lock_dispatcher_ = new RenderViewMouseLockDispatcher(this); |
| 804 | 799 |
| 805 history_controller_.reset(new HistoryController(this)); | 800 history_controller_.reset(new HistoryController(this)); |
| 806 | 801 |
| 807 // Create renderer_accessibility_ if needed. | |
| 808 OnSetAccessibilityMode(params->accessibility_mode); | |
| 809 | |
| 810 new IdleUserDetector(this); | 802 new IdleUserDetector(this); |
| 811 | 803 |
| 812 if (command_line.HasSwitch(switches::kDomAutomationController)) | 804 if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 813 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; | 805 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 814 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 806 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 815 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; | 807 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
| 816 | 808 |
| 817 ProcessViewLayoutFlags(command_line); | 809 ProcessViewLayoutFlags(command_line); |
| 818 | 810 |
| 819 GetContentClient()->renderer()->RenderViewCreated(this); | 811 GetContentClient()->renderer()->RenderViewCreated(this); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 int32 main_frame_routing_id, | 906 int32 main_frame_routing_id, |
| 915 int32 surface_id, | 907 int32 surface_id, |
| 916 int64 session_storage_namespace_id, | 908 int64 session_storage_namespace_id, |
| 917 const base::string16& frame_name, | 909 const base::string16& frame_name, |
| 918 bool is_renderer_created, | 910 bool is_renderer_created, |
| 919 bool swapped_out, | 911 bool swapped_out, |
| 920 int32 proxy_routing_id, | 912 int32 proxy_routing_id, |
| 921 bool hidden, | 913 bool hidden, |
| 922 bool never_visible, | 914 bool never_visible, |
| 923 int32 next_page_id, | 915 int32 next_page_id, |
| 924 const blink::WebScreenInfo& screen_info, | 916 const blink::WebScreenInfo& screen_info) { |
| 925 AccessibilityMode accessibility_mode) { | |
| 926 DCHECK(routing_id != MSG_ROUTING_NONE); | 917 DCHECK(routing_id != MSG_ROUTING_NONE); |
| 927 RenderViewImplParams params(opener_id, | 918 RenderViewImplParams params(opener_id, |
| 928 window_was_created_with_opener, | 919 window_was_created_with_opener, |
| 929 renderer_prefs, | 920 renderer_prefs, |
| 930 webkit_prefs, | 921 webkit_prefs, |
| 931 routing_id, | 922 routing_id, |
| 932 main_frame_routing_id, | 923 main_frame_routing_id, |
| 933 surface_id, | 924 surface_id, |
| 934 session_storage_namespace_id, | 925 session_storage_namespace_id, |
| 935 frame_name, | 926 frame_name, |
| 936 is_renderer_created, | 927 is_renderer_created, |
| 937 swapped_out, | 928 swapped_out, |
| 938 proxy_routing_id, | 929 proxy_routing_id, |
| 939 hidden, | 930 hidden, |
| 940 never_visible, | 931 never_visible, |
| 941 next_page_id, | 932 next_page_id, |
| 942 screen_info, | 933 screen_info); |
| 943 accessibility_mode); | |
| 944 RenderViewImpl* render_view = NULL; | 934 RenderViewImpl* render_view = NULL; |
| 945 if (g_create_render_view_impl) | 935 if (g_create_render_view_impl) |
| 946 render_view = g_create_render_view_impl(¶ms); | 936 render_view = g_create_render_view_impl(¶ms); |
| 947 else | 937 else |
| 948 render_view = new RenderViewImpl(¶ms); | 938 render_view = new RenderViewImpl(¶ms); |
| 949 | 939 |
| 950 render_view->Initialize(¶ms); | 940 render_view->Initialize(¶ms); |
| 951 return render_view; | 941 return render_view; |
| 952 } | 942 } |
| 953 | 943 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 IPC_MESSAGE_HANDLER(ViewMsg_GetAllSavableResourceLinksForCurrentPage, | 1112 IPC_MESSAGE_HANDLER(ViewMsg_GetAllSavableResourceLinksForCurrentPage, |
| 1123 OnGetAllSavableResourceLinksForCurrentPage) | 1113 OnGetAllSavableResourceLinksForCurrentPage) |
| 1124 IPC_MESSAGE_HANDLER( | 1114 IPC_MESSAGE_HANDLER( |
| 1125 ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, | 1115 ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, |
| 1126 OnGetSerializedHtmlDataForCurrentPageWithLocalLinks) | 1116 OnGetSerializedHtmlDataForCurrentPageWithLocalLinks) |
| 1127 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) | 1117 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) |
| 1128 // TODO(viettrungluu): Move to a separate message filter. | 1118 // TODO(viettrungluu): Move to a separate message filter. |
| 1129 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 1119 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
| 1130 OnSetHistoryLengthAndPrune) | 1120 OnSetHistoryLengthAndPrune) |
| 1131 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1121 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 1132 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) | |
| 1133 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) | 1122 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) |
| 1134 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, | 1123 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, |
| 1135 OnReleaseDisambiguationPopupBitmap) | 1124 OnReleaseDisambiguationPopupBitmap) |
| 1136 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, | 1125 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, |
| 1137 OnWindowSnapshotCompleted) | 1126 OnWindowSnapshotCompleted) |
| 1138 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) | 1127 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) |
| 1139 #if defined(OS_ANDROID) | 1128 #if defined(OS_ANDROID) |
| 1140 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, | 1129 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
| 1141 OnActivateNearestFindResult) | 1130 OnActivateNearestFindResult) |
| 1142 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) | 1131 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 main_frame_routing_id, | 1461 main_frame_routing_id, |
| 1473 surface_id, | 1462 surface_id, |
| 1474 cloned_session_storage_namespace_id, | 1463 cloned_session_storage_namespace_id, |
| 1475 base::string16(), // WebCore will take care of setting the correct name. | 1464 base::string16(), // WebCore will take care of setting the correct name. |
| 1476 true, // is_renderer_created | 1465 true, // is_renderer_created |
| 1477 false, // swapped_out | 1466 false, // swapped_out |
| 1478 MSG_ROUTING_NONE, // proxy_routing_id | 1467 MSG_ROUTING_NONE, // proxy_routing_id |
| 1479 params.disposition == NEW_BACKGROUND_TAB, // hidden | 1468 params.disposition == NEW_BACKGROUND_TAB, // hidden |
| 1480 never_visible, | 1469 never_visible, |
| 1481 1, // next_page_id | 1470 1, // next_page_id |
| 1482 screen_info_, | 1471 screen_info_); |
| 1483 accessibility_mode_); | |
| 1484 view->opened_by_user_gesture_ = params.user_gesture; | 1472 view->opened_by_user_gesture_ = params.user_gesture; |
| 1485 | 1473 |
| 1486 // Record whether the creator frame is trying to suppress the opener field. | 1474 // Record whether the creator frame is trying to suppress the opener field. |
| 1487 view->opener_suppressed_ = params.opener_suppressed; | 1475 view->opener_suppressed_ = params.opener_suppressed; |
| 1488 | 1476 |
| 1489 return view->webview(); | 1477 return view->webview(); |
| 1490 } | 1478 } |
| 1491 | 1479 |
| 1492 WebWidget* RenderViewImpl::createPopupMenu(blink::WebPopupType popup_type) { | 1480 WebWidget* RenderViewImpl::createPopupMenu(blink::WebPopupType popup_type) { |
| 1493 RenderWidget* widget = | 1481 RenderWidget* widget = |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 void RenderViewImpl::focusPrevious() { | 1769 void RenderViewImpl::focusPrevious() { |
| 1782 Send(new ViewHostMsg_TakeFocus(routing_id_, true)); | 1770 Send(new ViewHostMsg_TakeFocus(routing_id_, true)); |
| 1783 } | 1771 } |
| 1784 | 1772 |
| 1785 void RenderViewImpl::focusedNodeChanged(const WebNode& node) { | 1773 void RenderViewImpl::focusedNodeChanged(const WebNode& node) { |
| 1786 has_scrolled_focused_editable_node_into_rect_ = false; | 1774 has_scrolled_focused_editable_node_into_rect_ = false; |
| 1787 | 1775 |
| 1788 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(node))); | 1776 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(node))); |
| 1789 | 1777 |
| 1790 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(node)); | 1778 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(node)); |
| 1779 |
| 1780 // TODO(dmazzoni): this should be part of RenderFrameObserver. |
| 1781 main_render_frame()->FocusedNodeChanged(node); |
| 1791 } | 1782 } |
| 1792 | 1783 |
| 1793 void RenderViewImpl::numberOfWheelEventHandlersChanged(unsigned num_handlers) { | 1784 void RenderViewImpl::numberOfWheelEventHandlersChanged(unsigned num_handlers) { |
| 1794 Send(new ViewHostMsg_DidChangeNumWheelEvents(routing_id_, num_handlers)); | 1785 Send(new ViewHostMsg_DidChangeNumWheelEvents(routing_id_, num_handlers)); |
| 1795 } | 1786 } |
| 1796 | 1787 |
| 1797 void RenderViewImpl::didUpdateLayout() { | 1788 void RenderViewImpl::didUpdateLayout() { |
| 1798 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidUpdateLayout()); | 1789 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidUpdateLayout()); |
| 1799 | 1790 |
| 1800 // We don't always want to set up a timer, only if we've been put in that | 1791 // We don't always want to set up a timer, only if we've been put in that |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1817 int RenderViewImpl::historyBackListCount() { | 1808 int RenderViewImpl::historyBackListCount() { |
| 1818 return history_list_offset_ < 0 ? 0 : history_list_offset_; | 1809 return history_list_offset_ < 0 ? 0 : history_list_offset_; |
| 1819 } | 1810 } |
| 1820 | 1811 |
| 1821 int RenderViewImpl::historyForwardListCount() { | 1812 int RenderViewImpl::historyForwardListCount() { |
| 1822 return history_list_length_ - historyBackListCount() - 1; | 1813 return history_list_length_ - historyBackListCount() - 1; |
| 1823 } | 1814 } |
| 1824 | 1815 |
| 1825 void RenderViewImpl::postAccessibilityEvent( | 1816 void RenderViewImpl::postAccessibilityEvent( |
| 1826 const WebAXObject& obj, blink::WebAXEvent event) { | 1817 const WebAXObject& obj, blink::WebAXEvent event) { |
| 1827 if (renderer_accessibility_) { | 1818 main_render_frame()->HandleWebAccessibilityEvent(obj, event); |
| 1828 renderer_accessibility_->HandleWebAccessibilityEvent(obj, event); | |
| 1829 } | |
| 1830 } | 1819 } |
| 1831 | 1820 |
| 1832 void RenderViewImpl::didUpdateInspectorSetting(const WebString& key, | 1821 void RenderViewImpl::didUpdateInspectorSetting(const WebString& key, |
| 1833 const WebString& value) { | 1822 const WebString& value) { |
| 1834 Send(new ViewHostMsg_UpdateInspectorSetting(routing_id_, | 1823 Send(new ViewHostMsg_UpdateInspectorSetting(routing_id_, |
| 1835 key.utf8(), | 1824 key.utf8(), |
| 1836 value.utf8())); | 1825 value.utf8())); |
| 1837 } | 1826 } |
| 1838 | 1827 |
| 1839 // blink::WebWidgetClient ---------------------------------------------------- | 1828 // blink::WebWidgetClient ---------------------------------------------------- |
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3201 webview()->clearFocusedElement(); | 3190 webview()->clearFocusedElement(); |
| 3202 } | 3191 } |
| 3203 | 3192 |
| 3204 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { | 3193 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { |
| 3205 if (webview()) | 3194 if (webview()) |
| 3206 webview()->setIsTransparent(!opaque); | 3195 webview()->setIsTransparent(!opaque); |
| 3207 if (compositor_) | 3196 if (compositor_) |
| 3208 compositor_->setHasTransparentBackground(!opaque); | 3197 compositor_->setHasTransparentBackground(!opaque); |
| 3209 } | 3198 } |
| 3210 | 3199 |
| 3211 void RenderViewImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | |
| 3212 if (accessibility_mode_ == new_mode) | |
| 3213 return; | |
| 3214 accessibility_mode_ = new_mode; | |
| 3215 if (renderer_accessibility_) { | |
| 3216 delete renderer_accessibility_; | |
| 3217 renderer_accessibility_ = NULL; | |
| 3218 } | |
| 3219 if (accessibility_mode_ == AccessibilityModeOff) | |
| 3220 return; | |
| 3221 | |
| 3222 if (accessibility_mode_ & AccessibilityModeFlagFullTree) | |
| 3223 renderer_accessibility_ = new RendererAccessibilityComplete(this); | |
| 3224 #if !defined(OS_ANDROID) | |
| 3225 else | |
| 3226 renderer_accessibility_ = new RendererAccessibilityFocusOnly(this); | |
| 3227 #endif | |
| 3228 } | |
| 3229 | |
| 3230 void RenderViewImpl::OnSetActive(bool active) { | 3200 void RenderViewImpl::OnSetActive(bool active) { |
| 3231 if (webview()) | 3201 if (webview()) |
| 3232 webview()->setIsActive(active); | 3202 webview()->setIsActive(active); |
| 3233 | 3203 |
| 3234 #if defined(ENABLE_PLUGINS) && defined(OS_MACOSX) | 3204 #if defined(ENABLE_PLUGINS) && defined(OS_MACOSX) |
| 3235 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 3205 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
| 3236 for (plugin_it = plugin_delegates_.begin(); | 3206 for (plugin_it = plugin_delegates_.begin(); |
| 3237 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 3207 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
| 3238 (*plugin_it)->SetWindowFocus(active); | 3208 (*plugin_it)->SetWindowFocus(active); |
| 3239 } | 3209 } |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3907 if (main_frame && main_frame->opener()) | 3877 if (main_frame && main_frame->opener()) |
| 3908 main_frame->setOpener(NULL); | 3878 main_frame->setOpener(NULL); |
| 3909 } | 3879 } |
| 3910 | 3880 |
| 3911 #if defined(OS_ANDROID) | 3881 #if defined(OS_ANDROID) |
| 3912 bool RenderViewImpl::didTapMultipleTargets( | 3882 bool RenderViewImpl::didTapMultipleTargets( |
| 3913 const blink::WebGestureEvent& event, | 3883 const blink::WebGestureEvent& event, |
| 3914 const WebVector<WebRect>& target_rects) { | 3884 const WebVector<WebRect>& target_rects) { |
| 3915 // Never show a disambiguation popup when accessibility is enabled, | 3885 // Never show a disambiguation popup when accessibility is enabled, |
| 3916 // as this interferes with "touch exploration". | 3886 // as this interferes with "touch exploration". |
| 3917 bool matchesAccessibilityModeComplete = | 3887 AccessibilityMode accessibility_mode = |
| 3918 (accessibility_mode_ & AccessibilityModeComplete) == | 3888 main_render_frame()->accessibility_mode(); |
| 3919 AccessibilityModeComplete; | 3889 bool matches_accessibility_mode_complete = |
| 3920 if (matchesAccessibilityModeComplete) | 3890 (accessibility_mode & AccessibilityModeComplete) == |
| 3891 AccessibilityModeComplete; |
| 3892 if (matches_accessibility_mode_complete) |
| 3921 return false; | 3893 return false; |
| 3922 | 3894 |
| 3923 gfx::Rect finger_rect( | 3895 gfx::Rect finger_rect( |
| 3924 event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, | 3896 event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, |
| 3925 event.data.tap.width, event.data.tap.height); | 3897 event.data.tap.width, event.data.tap.height); |
| 3926 gfx::Rect zoom_rect; | 3898 gfx::Rect zoom_rect; |
| 3927 float new_total_scale = | 3899 float new_total_scale = |
| 3928 DisambiguationPopupHelper::ComputeZoomAreaAndScaleFactor( | 3900 DisambiguationPopupHelper::ComputeZoomAreaAndScaleFactor( |
| 3929 finger_rect, target_rects, GetSize(), | 3901 finger_rect, target_rects, GetSize(), |
| 3930 gfx::Rect(webview()->mainFrame()->visibleContentRect()).size(), | 3902 gfx::Rect(webview()->mainFrame()->visibleContentRect()).size(), |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4105 std::vector<gfx::Size> sizes; | 4077 std::vector<gfx::Size> sizes; |
| 4106 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4078 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4107 if (!url.isEmpty()) | 4079 if (!url.isEmpty()) |
| 4108 urls.push_back( | 4080 urls.push_back( |
| 4109 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4081 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4110 } | 4082 } |
| 4111 SendUpdateFaviconURL(urls); | 4083 SendUpdateFaviconURL(urls); |
| 4112 } | 4084 } |
| 4113 | 4085 |
| 4114 } // namespace content | 4086 } // namespace content |
| OLD | NEW |