| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 9cf92a6a88247150d1f03d936f010ae746cd3c51..06e16b9f281c26c31f544351ccedd206bd28974b 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -84,6 +84,7 @@
|
|
|
| #if defined(OS_ANDROID)
|
| #include <android/keycodes.h>
|
| +#include "base/time/time.h"
|
| #endif
|
|
|
| #if defined(OS_POSIX)
|
| @@ -199,6 +200,12 @@ ui::TextInputMode ConvertWebTextInputMode(blink::WebTextInputMode mode) {
|
|
|
| namespace content {
|
|
|
| +#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
|
| +
|
| // RenderWidget ---------------------------------------------------------------
|
|
|
| RenderWidget::RenderWidget(CompositorDependencies* compositor_deps,
|
| @@ -243,6 +250,7 @@ RenderWidget::RenderWidget(CompositorDependencies* compositor_deps,
|
| frame_swap_message_queue_(new FrameSwapMessageQueue()),
|
| resizing_mode_selector_(new ResizingModeSelector()),
|
| has_host_context_menu_location_(false),
|
| + has_added_input_handler_(false),
|
| has_focus_(false),
|
| #if defined(OS_MACOSX)
|
| text_input_client_observer_(new TextInputClientObserver(this)),
|
| @@ -1120,6 +1128,28 @@ void RenderWidget::initializeLayerTreeView() {
|
| compositor_->SetNeverVisible();
|
|
|
| StartCompositor();
|
| +
|
| + 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(
|
| + routing_id_, compositor()->GetInputHandler(), AsWeakPtr(), true);
|
| + has_added_input_handler_ = true;
|
| + }
|
| }
|
|
|
| void RenderWidget::WillCloseLayerTreeView() {
|
| @@ -1627,6 +1657,19 @@ void RenderWidget::OnImeBatchEdit(bool begin) {
|
| UpdateSelectionBounds();
|
| UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME);
|
| }
|
| +
|
| +void RenderWidget::scheduleContentIntentForRenderView(
|
| + const blink::WebURL& intent,
|
| + bool is_main_frame,
|
| + size_t expected_content_intent_id) {
|
| + // Introduce a short delay so that the user can notice the content.
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| + FROM_HERE,
|
| + base::Bind(&RenderWidget::LaunchAndroidContentIntent,
|
| + static_cast<RenderWidget*>(this)->AsWeakPtr(),
|
| + intent, expected_content_intent_id, is_main_frame),
|
| + base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds));
|
| +}
|
| #endif
|
|
|
| void RenderWidget::OnRequestCompositionUpdate(bool immediate_request,
|
|
|