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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 138893003: [Android] Disable the touch ack timeout on mobile sites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Let's try making it compile, shall we? Created 6 years, 11 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 93d865b4a0cae79c44829ff6986df497cf42f871..dd9fdb5805d9ee844385ad99455dcb9f449cc3ba 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -101,6 +101,21 @@ typedef base::hash_map<RenderWidgetHostID, RenderWidgetHostImpl*>
base::LazyInstance<RoutingIDWidgetMap> g_routing_id_widget_map =
LAZY_INSTANCE_INITIALIZER;
+int GetInputRouterViewFlagsFromCompositorFrameMetadata(
+ const cc::CompositorFrameMetadata metadata) {
+ int view_flags = InputRouter::VIEW_FLAGS_NONE;
+
+ if (metadata.min_page_scale_factor == metadata.max_page_scale_factor)
+ view_flags |= InputRouter::FIXED_PAGE_SCALE;
+
+ float window_width_dip =
+ metadata.page_scale_factor * metadata.viewport_size.width();
+ if (metadata.root_layer_size.width() <= window_width_dip)
Xianzhu 2014/01/14 21:54:19 Can we simply skip timeout for all pages with view
jdduke (slow) 2014/01/14 21:56:38 Where do we get that data?
Xianzhu 2014/01/14 23:56:18 My fault. I thought it is available in the metadat
johnme 2014/01/15 02:15:09 No, many desktop sites have viewport tags like <me
+ view_flags |= InputRouter::MOBILE_VIEWPORT;
+
+ return view_flags;
Xianzhu 2014/01/14 21:54:19 Will the individual bits of view_flags be meaningf
jdduke (slow) 2014/01/14 21:56:38 Currently, no, it's only useful for the ack timeou
+}
+
// Implements the RenderWidgetHostIterator interface. It keeps a list of
// RenderWidgetHosts, and makes sure it returns a live RenderWidgetHost at each
// iteration (or NULL if there isn't any left).
@@ -1499,12 +1514,8 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame(
uint32 output_surface_id = param.a;
param.b.AssignTo(frame.get());
- bool fixed_page_scale =
- frame->metadata.min_page_scale_factor ==
- frame->metadata.max_page_scale_factor;
- int updated_view_flags = fixed_page_scale ? InputRouter::FIXED_PAGE_SCALE
- : InputRouter::VIEW_FLAGS_NONE;
- input_router_->OnViewUpdated(updated_view_flags);
+ input_router_->OnViewUpdated(
+ GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata));
if (view_) {
view_->OnSwapCompositorFrame(output_surface_id, frame.Pass());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698