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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 492
493 // Handle autoplay gesture override experiment. 493 // Handle autoplay gesture override experiment.
494 // Note that anything but a well-formed string turns the experiment off. 494 // Note that anything but a well-formed string turns the experiment off.
495 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName( 495 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName(
496 "MediaElementGestureOverrideExperiment"); 496 "MediaElementGestureOverrideExperiment");
497 497
498 prefs.touch_enabled = ui::AreTouchEventsEnabled(); 498 prefs.touch_enabled = ui::AreTouchEventsEnabled();
499 prefs.device_supports_touch = prefs.touch_enabled && 499 prefs.device_supports_touch = prefs.touch_enabled &&
500 ui::GetTouchScreensAvailability() == 500 ui::GetTouchScreensAvailability() ==
501 ui::TouchScreensAvailability::ENABLED; 501 ui::TouchScreensAvailability::ENABLED;
502 prefs.available_pointer_types = ui::GetAvailablePointerTypes(); 502 std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
503 prefs.primary_pointer_type = ui::GetPrimaryPointerType(); 503 ui::GetAvailablePointerAndHoverTypes();
504 prefs.available_hover_types = ui::GetAvailableHoverTypes(); 504 prefs.primary_pointer_type =
505 prefs.primary_hover_type = ui::GetPrimaryHoverType(); 505 ui::GetPrimaryPointerType(prefs.available_pointer_types);
506 prefs.primary_hover_type =
507 ui::GetPrimaryHoverType(prefs.available_hover_types);
506 508
507 #if defined(OS_ANDROID) 509 #if defined(OS_ANDROID)
508 prefs.device_supports_mouse = false; 510 prefs.device_supports_mouse = false;
509 #endif 511 #endif
510 512
511 prefs.pointer_events_max_touch_points = ui::MaxTouchPoints(); 513 prefs.pointer_events_max_touch_points = ui::MaxTouchPoints();
512 514
513 prefs.touch_adjustment_enabled = 515 prefs.touch_adjustment_enabled =
514 !command_line.HasSwitch(switches::kDisableTouchAdjustment); 516 !command_line.HasSwitch(switches::kDisableTouchAdjustment);
515 517
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 // Note: We are using the origin URL provided by the sender here. It may be 1326 // Note: We are using the origin URL provided by the sender here. It may be
1325 // different from the receiver's. 1327 // different from the receiver's.
1326 file_system_file.url = 1328 file_system_file.url =
1327 GURL(storage::GetIsolatedFileSystemRootURIString( 1329 GURL(storage::GetIsolatedFileSystemRootURIString(
1328 file_system_url.origin(), filesystem_id, std::string()) 1330 file_system_url.origin(), filesystem_id, std::string())
1329 .append(register_name)); 1331 .append(register_name));
1330 } 1332 }
1331 } 1333 }
1332 1334
1333 } // namespace content 1335 } // namespace content
OLDNEW
« 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