| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 421 |
| 422 #if defined(OS_ANDROID) | 422 #if defined(OS_ANDROID) |
| 423 // On Android, user gestures are normally required, unless that requirement | 423 // On Android, user gestures are normally required, unless that requirement |
| 424 // is disabled with a command-line switch or the equivalent field trial is | 424 // is disabled with a command-line switch or the equivalent field trial is |
| 425 // is set to "Enabled". | 425 // is set to "Enabled". |
| 426 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( | 426 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( |
| 427 "MediaElementAutoplay"); | 427 "MediaElementAutoplay"); |
| 428 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( | 428 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( |
| 429 switches::kDisableGestureRequirementForMediaPlayback) && | 429 switches::kDisableGestureRequirementForMediaPlayback) && |
| 430 (autoplay_group_name.empty() || autoplay_group_name != "Enabled"); | 430 (autoplay_group_name.empty() || autoplay_group_name != "Enabled"); |
| 431 prefs.autoplay_muted_videos_enabled = command_line.HasSwitch( |
| 432 switches::kEnableAutoplayMutedVideos); |
| 431 #endif | 433 #endif |
| 432 | 434 |
| 433 // Handle autoplay gesture override experiment. | 435 // Handle autoplay gesture override experiment. |
| 434 // Note that anything but a well-formed string turns the experiment off. | 436 // Note that anything but a well-formed string turns the experiment off. |
| 435 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName( | 437 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName( |
| 436 "MediaElementGestureOverrideExperiment"); | 438 "MediaElementGestureOverrideExperiment"); |
| 437 | 439 |
| 438 prefs.touch_enabled = ui::AreTouchEventsEnabled(); | 440 prefs.touch_enabled = ui::AreTouchEventsEnabled(); |
| 439 prefs.device_supports_touch = prefs.touch_enabled && | 441 prefs.device_supports_touch = prefs.touch_enabled && |
| 440 ui::GetTouchScreensAvailability() == | 442 ui::GetTouchScreensAvailability() == |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 } else { | 1323 } else { |
| 1322 render_view_ready_on_process_launch_ = true; | 1324 render_view_ready_on_process_launch_ = true; |
| 1323 } | 1325 } |
| 1324 } | 1326 } |
| 1325 | 1327 |
| 1326 void RenderViewHostImpl::RenderViewReady() { | 1328 void RenderViewHostImpl::RenderViewReady() { |
| 1327 delegate_->RenderViewReady(this); | 1329 delegate_->RenderViewReady(this); |
| 1328 } | 1330 } |
| 1329 | 1331 |
| 1330 } // namespace content | 1332 } // namespace content |
| OLD | NEW |