Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index 14a3e97ea2d7698f053d971bfdde86b86d814da8..bf45c18fd8be6a4d1f16351d0a5246015bd68454 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -282,12 +282,6 @@ static base::LazyInstance<RoutingIDViewMap> g_routing_id_view_map = |
| const int kDelaySecondsForContentStateSyncHidden = 5; |
| const int kDelaySecondsForContentStateSync = 1; |
| -#if defined(OS_ANDROID) |
| -// Delay between tapping in content and launching the associated android intent. |
| -// Used to allow users see what has been recognized as content. |
| -const size_t kContentIntentDelayMilliseconds = 700; |
| -#endif |
| - |
| static RenderViewImpl* (*g_create_render_view_impl)( |
| CompositorDependencies* compositor_deps, |
| const mojom::CreateViewParams&) = nullptr; |
| @@ -690,8 +684,7 @@ RenderViewImpl::RenderViewImpl(CompositorDependencies* compositor_deps, |
| expected_content_intent_id_(0), |
| #endif |
| enumeration_completion_id_(0), |
| - session_storage_namespace_id_(params.session_storage_namespace_id), |
| - has_added_input_handler_(false) { |
| + session_storage_namespace_id_(params.session_storage_namespace_id) { |
| GetWidget()->set_owner_delegate(this); |
| } |
| @@ -1988,33 +1981,18 @@ void RenderViewImpl::didHandleGestureEvent( |
| } |
| void RenderViewImpl::initializeLayerTreeView() { |
| + // TODO(!wjmaclean): We should be able to just remove this function, and |
| + // expect the RenderWidget version of the function to be called instead. |
|
Avi (use Gerrit)
2016/11/07 16:15:55
Soon. Soon. 🤞
wjmaclean
2016/11/07 17:43:17
Acknowledged.
|
| + // However, we have a diamond inheritance pattern going on: |
| + // WebWidgetClient |
| + // | | |
| + // RenderWidget WebViewClient |
| + // | | |
| + // RenderViewImpl |
| + // |
| + // and this seems to prefer calling the empty version in WebWidgetClient |
| + // or WebViewClient over the non-empty one in RenderWidget. |
| RenderWidget::initializeLayerTreeView(); |
| - RenderWidgetCompositor* rwc = compositor(); |
| - if (!rwc) |
| - return; |
| - |
| - bool use_threaded_event_handling = true; |
| -#if defined(OS_MACOSX) |
| - // Disable threaded event handling if content is not handling the elastic |
| - // overscroll effect. This includes the cases where the elastic overscroll |
| - // effect is being handled by Blink (because of command line flags) and older |
| - // operating system versions which do not have an elastic overscroll effect |
| - // (SnowLeopard, which has Aqua scrollbars which need synchronous updates). |
| - use_threaded_event_handling = compositor_deps_->IsElasticOverscrollEnabled(); |
| -#endif |
| - if (!use_threaded_event_handling) |
| - return; |
| - |
| - RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| - // render_thread may be NULL in tests. |
| - InputHandlerManager* input_handler_manager = |
| - render_thread ? render_thread->input_handler_manager() : NULL; |
| - if (input_handler_manager) { |
| - input_handler_manager->AddInputHandler( |
| - GetRoutingID(), rwc->GetInputHandler(), AsWeakPtr(), |
| - webkit_preferences_.enable_scroll_animator); |
| - has_added_input_handler_ = true; |
| - } |
| } |
| void RenderViewImpl::closeWidgetSoon() { |
| @@ -2736,12 +2714,8 @@ WebURL RenderViewImpl::detectContentIntentAt( |
| void RenderViewImpl::scheduleContentIntent(const WebURL& intent, |
| bool is_main_frame) { |
| - // Introduce a short delay so that the user can notice the content. |
| - base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| - FROM_HERE, |
| - base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, AsWeakPtr(), |
| - intent, expected_content_intent_id_, is_main_frame), |
| - base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); |
| + scheduleContentIntentForRenderView(intent, is_main_frame, |
| + expected_content_intent_id_); |
| } |
| void RenderViewImpl::cancelScheduledContentIntents() { |