Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: content/renderer/render_widget.cc

Issue 2417783005: [Master/Overview CL] Make PageScaleFactor work for oopif subframe.
Patch Set: Rebase to master@{#429656}. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | third_party/WebKit/Source/core/frame/EventHandlerRegistry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « content/renderer/render_widget.h ('k') | third_party/WebKit/Source/core/frame/EventHandlerRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698