Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index ebfac09d0234e261dfa0541562a73189c46c27e2..c3784bb266de5a8de1f3998fbcfb697be4972fc9 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); |
} |
@@ -1959,33 +1952,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. |
+ // 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() { |
@@ -2707,12 +2685,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() { |