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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 prefs.use_solid_color_scrollbars = false; | 433 prefs.use_solid_color_scrollbars = false; |
434 | 434 |
435 prefs.history_entry_requires_user_gesture = | 435 prefs.history_entry_requires_user_gesture = |
436 command_line.HasSwitch(switches::kHistoryEntryRequiresUserGesture); | 436 command_line.HasSwitch(switches::kHistoryEntryRequiresUserGesture); |
437 | 437 |
438 #if defined(OS_ANDROID) | 438 #if defined(OS_ANDROID) |
439 // On Android, user gestures are normally required, unless that requirement | 439 // On Android, user gestures are normally required, unless that requirement |
440 // is disabled with a command-line switch or the equivalent field trial is | 440 // is disabled with a command-line switch or the equivalent field trial is |
441 // is set to "Enabled". | 441 // is set to "Enabled". |
442 prefs.user_gesture_required_for_media_playback = | 442 prefs.user_gesture_required_for_media_playback = |
443 !command_line.HasSwitch( | 443 !command_line.HasSwitch(switches::kIgnoreAutoplayRestrictionsForTests) && |
444 switches::kDisableGestureRequirementForMediaPlayback) && | |
445 command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) != | 444 command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) != |
446 switches::autoplay::kNoUserGestureRequiredPolicy; | 445 switches::autoplay::kNoUserGestureRequiredPolicy; |
447 | 446 |
448 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); | 447 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); |
449 | 448 |
450 prefs.use_solid_color_scrollbars = true; | 449 prefs.use_solid_color_scrollbars = true; |
451 #else // defined(OS_ANDROID) | 450 #else // defined(OS_ANDROID) |
452 prefs.cross_origin_media_playback_requires_user_gesture = | 451 prefs.cross_origin_media_playback_requires_user_gesture = |
453 command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) == | 452 command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) == |
454 switches::autoplay::kCrossOriginUserGestureRequiredPolicy; | 453 switches::autoplay::kCrossOriginUserGestureRequiredPolicy; |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 } | 955 } |
957 | 956 |
958 void RenderViewHostImpl::ClosePageTimeout() { | 957 void RenderViewHostImpl::ClosePageTimeout() { |
959 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 958 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
960 return; | 959 return; |
961 | 960 |
962 ClosePageIgnoringUnloadEvents(); | 961 ClosePageIgnoringUnloadEvents(); |
963 } | 962 } |
964 | 963 |
965 } // namespace content | 964 } // namespace content |
OLD | NEW |