| Index: content/renderer/render_view_impl.cc
|
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
| index 4eb5045c47941f3959b48ef234dae0e5be28f148..bfd90dc25ac8485b9ff866f5a8b703a19944303e 100644
|
| --- a/content/renderer/render_view_impl.cc
|
| +++ b/content/renderer/render_view_impl.cc
|
| @@ -286,12 +286,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;
|
| @@ -694,8 +688,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);
|
| }
|
|
|
| @@ -1363,6 +1356,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
| OnUpdateWindowScreenRect)
|
| IPC_MESSAGE_HANDLER(PageMsg_SetZoomLevel, OnSetZoomLevel)
|
| IPC_MESSAGE_HANDLER(PageMsg_SetDeviceScaleFactor, OnSetDeviceScaleFactor);
|
| + IPC_MESSAGE_HANDLER(PageMsg_SetPageScaleFactor,
|
| + OnSetPageScaleFactorForSubframes);
|
| IPC_MESSAGE_HANDLER(PageMsg_WasHidden, OnPageWasHidden)
|
| IPC_MESSAGE_HANDLER(PageMsg_WasShown, OnPageWasShown)
|
| IPC_MESSAGE_HANDLER(PageMsg_SetHistoryOffsetAndLength,
|
| @@ -1987,33 +1982,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() {
|
| @@ -2636,6 +2616,24 @@ void RenderViewImpl::OnDeviceScaleFactorChanged() {
|
| AutoResizeCompositor();
|
| }
|
|
|
| +void RenderViewImpl::OnSetPageScaleFactorForSubframes(double page_scale) {
|
| + if (webview() && webview()->mainFrame() &&
|
| + !webview()->mainFrame()->isWebLocalFrame()) {
|
| + // TODO(wjmaclean): Find a better way to identify the local roots in the
|
| + // frame tree. Still, this is likely better than sending a separate IPC for
|
| + // every frame in a renderer.
|
| + for (WebFrame* frame = webview()->mainFrame(); frame;
|
| + frame = frame->traverseNext()) {
|
| + if (frame->isWebLocalFrame() && !frame->parent()->isWebLocalFrame()) {
|
| + RenderFrameImpl* rfi = RenderFrameImpl::FromWebFrame(frame);
|
| + RenderWidgetCompositor* widget_compositor =
|
| + rfi->GetRenderWidget()->compositor();
|
| + widget_compositor->SetPageScaleFactorForSubframe(page_scale);
|
| + }
|
| + }
|
| + }
|
| +}
|
| +
|
| void RenderViewImpl::SetScreenMetricsEmulationParameters(
|
| bool enabled,
|
| const blink::WebDeviceEmulationParams& params) {
|
| @@ -2735,12 +2733,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() {
|
|
|