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

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

Issue 2301073002: Optimization: avoid making 4 JNI calls to get touch device attributes. (Closed)
Patch Set: Fix windows compile issues Created 4 years, 3 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 | ui/android/java/src/org/chromium/ui/base/TouchDevice.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index cb95627636f8e99a47269a056d913d07cd226e83..db80f8dce70161ddb865f00b604f69aaa4426f31 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -499,10 +499,12 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
prefs.device_supports_touch = prefs.touch_enabled &&
ui::GetTouchScreensAvailability() ==
ui::TouchScreensAvailability::ENABLED;
- prefs.available_pointer_types = ui::GetAvailablePointerTypes();
- prefs.primary_pointer_type = ui::GetPrimaryPointerType();
- prefs.available_hover_types = ui::GetAvailableHoverTypes();
- prefs.primary_hover_type = ui::GetPrimaryHoverType();
+ std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
+ ui::GetAvailablePointerAndHoverTypes();
+ prefs.primary_pointer_type =
+ ui::GetPrimaryPointerType(prefs.available_pointer_types);
+ prefs.primary_hover_type =
+ ui::GetPrimaryHoverType(prefs.available_hover_types);
#if defined(OS_ANDROID)
prefs.device_supports_mouse = false;
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/base/TouchDevice.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698