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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2531413002: Reset the default value of touch event flag back to "Auto". (Closed)
Patch Set: Wording. Created 4 years 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
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // is disabled with a command-line switch or the equivalent field trial is 435 // is disabled with a command-line switch or the equivalent field trial is
436 // is set to "Enabled". 436 // is set to "Enabled".
437 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( 437 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch(
438 switches::kDisableGestureRequirementForMediaPlayback); 438 switches::kDisableGestureRequirementForMediaPlayback);
439 439
440 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); 440 prefs.progress_bar_completion = GetProgressBarCompletionPolicy();
441 441
442 prefs.use_solid_color_scrollbars = true; 442 prefs.use_solid_color_scrollbars = true;
443 #endif 443 #endif
444 444
445 prefs.touch_event_api_enabled =
446 !command_line.HasSwitch(switches::kTouchEvents) ||
447 command_line.GetSwitchValueASCII(switches::kTouchEvents) !=
448 switches::kTouchEventsDisabled;
449 prefs.device_supports_touch = ui::GetTouchScreensAvailability() == 445 prefs.device_supports_touch = ui::GetTouchScreensAvailability() ==
450 ui::TouchScreensAvailability::ENABLED; 446 ui::TouchScreensAvailability::ENABLED;
447 const std::string touch_enabled_switch =
448 command_line.HasSwitch(switches::kTouchEvents)
449 ? command_line.GetSwitchValueASCII(switches::kTouchEvents)
450 : switches::kTouchEventsAuto;
451 prefs.touch_event_api_enabled =
452 (touch_enabled_switch == switches::kTouchEventsAuto)
453 ? prefs.device_supports_touch
454 : (touch_enabled_switch.empty() ||
455 touch_enabled_switch == switches::kTouchEventsEnabled);
451 std::tie(prefs.available_pointer_types, prefs.available_hover_types) = 456 std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
452 ui::GetAvailablePointerAndHoverTypes(); 457 ui::GetAvailablePointerAndHoverTypes();
453 prefs.primary_pointer_type = 458 prefs.primary_pointer_type =
454 ui::GetPrimaryPointerType(prefs.available_pointer_types); 459 ui::GetPrimaryPointerType(prefs.available_pointer_types);
455 prefs.primary_hover_type = 460 prefs.primary_hover_type =
456 ui::GetPrimaryHoverType(prefs.available_hover_types); 461 ui::GetPrimaryHoverType(prefs.available_hover_types);
457 462
458 #if defined(OS_ANDROID) 463 #if defined(OS_ANDROID)
459 prefs.device_supports_mouse = false; 464 prefs.device_supports_mouse = false;
460 #endif 465 #endif
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 } else { 1080 } else {
1076 render_view_ready_on_process_launch_ = true; 1081 render_view_ready_on_process_launch_ = true;
1077 } 1082 }
1078 } 1083 }
1079 1084
1080 void RenderViewHostImpl::RenderViewReady() { 1085 void RenderViewHostImpl::RenderViewReady() {
1081 delegate_->RenderViewReady(this); 1086 delegate_->RenderViewReady(this);
1082 } 1087 }
1083 1088
1084 } // namespace content 1089 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698