| OLD | NEW |
| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 426 |
| 427 prefs.use_solid_color_scrollbars = false; | 427 prefs.use_solid_color_scrollbars = false; |
| 428 | 428 |
| 429 prefs.history_entry_requires_user_gesture = | 429 prefs.history_entry_requires_user_gesture = |
| 430 command_line.HasSwitch(switches::kHistoryEntryRequiresUserGesture); | 430 command_line.HasSwitch(switches::kHistoryEntryRequiresUserGesture); |
| 431 | 431 |
| 432 #if defined(OS_ANDROID) | 432 #if defined(OS_ANDROID) |
| 433 // On Android, user gestures are normally required, unless that requirement | 433 // On Android, user gestures are normally required, unless that requirement |
| 434 // is disabled with a command-line switch or the equivalent field trial is | 434 // is disabled with a command-line switch or the equivalent field trial is |
| 435 // is set to "Enabled". | 435 // is set to "Enabled". |
| 436 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( | |
| 437 "MediaElementAutoplay"); | |
| 438 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( | 436 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( |
| 439 switches::kDisableGestureRequirementForMediaPlayback) && | 437 switches::kDisableGestureRequirementForMediaPlayback); |
| 440 (autoplay_group_name.empty() || autoplay_group_name != "Enabled"); | |
| 441 | 438 |
| 442 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); | 439 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); |
| 443 | 440 |
| 444 prefs.use_solid_color_scrollbars = true; | 441 prefs.use_solid_color_scrollbars = true; |
| 445 #endif | 442 #endif |
| 446 | 443 |
| 447 // Handle autoplay gesture override experiment. | |
| 448 // Note that anything but a well-formed string turns the experiment off. | |
| 449 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName( | |
| 450 "MediaElementGestureOverrideExperiment"); | |
| 451 | |
| 452 prefs.touch_enabled = ui::AreTouchEventsEnabled(); | 444 prefs.touch_enabled = ui::AreTouchEventsEnabled(); |
| 453 prefs.device_supports_touch = prefs.touch_enabled && | 445 prefs.device_supports_touch = prefs.touch_enabled && |
| 454 ui::GetTouchScreensAvailability() == | 446 ui::GetTouchScreensAvailability() == |
| 455 ui::TouchScreensAvailability::ENABLED; | 447 ui::TouchScreensAvailability::ENABLED; |
| 456 std::tie(prefs.available_pointer_types, prefs.available_hover_types) = | 448 std::tie(prefs.available_pointer_types, prefs.available_hover_types) = |
| 457 ui::GetAvailablePointerAndHoverTypes(); | 449 ui::GetAvailablePointerAndHoverTypes(); |
| 458 prefs.primary_pointer_type = | 450 prefs.primary_pointer_type = |
| 459 ui::GetPrimaryPointerType(prefs.available_pointer_types); | 451 ui::GetPrimaryPointerType(prefs.available_pointer_types); |
| 460 prefs.primary_hover_type = | 452 prefs.primary_hover_type = |
| 461 ui::GetPrimaryHoverType(prefs.available_hover_types); | 453 ui::GetPrimaryHoverType(prefs.available_hover_types); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 } else { | 1065 } else { |
| 1074 render_view_ready_on_process_launch_ = true; | 1066 render_view_ready_on_process_launch_ = true; |
| 1075 } | 1067 } |
| 1076 } | 1068 } |
| 1077 | 1069 |
| 1078 void RenderViewHostImpl::RenderViewReady() { | 1070 void RenderViewHostImpl::RenderViewReady() { |
| 1079 delegate_->RenderViewReady(this); | 1071 delegate_->RenderViewReady(this); |
| 1080 } | 1072 } |
| 1081 | 1073 |
| 1082 } // namespace content | 1074 } // namespace content |
| OLD | NEW |