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

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

Issue 2510353004: Deprecating AutoplayExperimentHelper (Closed)
Patch Set: rebased 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
« no previous file with comments | « no previous file | content/public/common/common_param_traits_macros.h » ('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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 prefs.use_solid_color_scrollbars = false; 428 prefs.use_solid_color_scrollbars = false;
429 429
430 prefs.history_entry_requires_user_gesture = 430 prefs.history_entry_requires_user_gesture =
431 command_line.HasSwitch(switches::kHistoryEntryRequiresUserGesture); 431 command_line.HasSwitch(switches::kHistoryEntryRequiresUserGesture);
432 432
433 #if defined(OS_ANDROID) 433 #if defined(OS_ANDROID)
434 // On Android, user gestures are normally required, unless that requirement 434 // On Android, user gestures are normally required, unless that requirement
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 const std::string autoplay_group_name = base::FieldTrialList::FindFullName(
438 "MediaElementAutoplay");
439 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( 437 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch(
440 switches::kDisableGestureRequirementForMediaPlayback) && 438 switches::kDisableGestureRequirementForMediaPlayback);
441 (autoplay_group_name.empty() || autoplay_group_name != "Enabled");
442 439
443 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); 440 prefs.progress_bar_completion = GetProgressBarCompletionPolicy();
444 441
445 prefs.use_solid_color_scrollbars = true; 442 prefs.use_solid_color_scrollbars = true;
446 #endif 443 #endif
447 444
448 // Handle autoplay gesture override experiment.
449 // Note that anything but a well-formed string turns the experiment off.
450 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName(
451 "MediaElementGestureOverrideExperiment");
452
453 prefs.touch_event_api_enabled = 445 prefs.touch_event_api_enabled =
454 !command_line.HasSwitch(switches::kTouchEvents) || 446 !command_line.HasSwitch(switches::kTouchEvents) ||
455 command_line.GetSwitchValueASCII(switches::kTouchEvents) != 447 command_line.GetSwitchValueASCII(switches::kTouchEvents) !=
456 switches::kTouchEventsDisabled; 448 switches::kTouchEventsDisabled;
457 prefs.device_supports_touch = ui::GetTouchScreensAvailability() == 449 prefs.device_supports_touch = ui::GetTouchScreensAvailability() ==
458 ui::TouchScreensAvailability::ENABLED; 450 ui::TouchScreensAvailability::ENABLED;
459 std::tie(prefs.available_pointer_types, prefs.available_hover_types) = 451 std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
460 ui::GetAvailablePointerAndHoverTypes(); 452 ui::GetAvailablePointerAndHoverTypes();
461 prefs.primary_pointer_type = 453 prefs.primary_pointer_type =
462 ui::GetPrimaryPointerType(prefs.available_pointer_types); 454 ui::GetPrimaryPointerType(prefs.available_pointer_types);
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 } else { 1075 } else {
1084 render_view_ready_on_process_launch_ = true; 1076 render_view_ready_on_process_launch_ = true;
1085 } 1077 }
1086 } 1078 }
1087 1079
1088 void RenderViewHostImpl::RenderViewReady() { 1080 void RenderViewHostImpl::RenderViewReady() {
1089 delegate_->RenderViewReady(this); 1081 delegate_->RenderViewReady(this);
1090 } 1082 }
1091 1083
1092 } // namespace content 1084 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698