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

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

Issue 2921273002: Autoplay: add document user activation flag in chrome://flags (Closed)
Patch Set: Created 3 years, 6 months 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 std::string autoplay_policy = media::GetEffectiveAutoplayPolicy(command_line); 460 std::string autoplay_policy = media::GetEffectiveAutoplayPolicy(command_line);
461 if (autoplay_policy == switches::autoplay::kNoUserGestureRequiredPolicy) { 461 if (autoplay_policy == switches::autoplay::kNoUserGestureRequiredPolicy) {
462 prefs.autoplay_policy = AutoplayPolicy::kNoUserGestureRequired; 462 prefs.autoplay_policy = AutoplayPolicy::kNoUserGestureRequired;
463 } else if (autoplay_policy == 463 } else if (autoplay_policy ==
464 switches::autoplay::kUserGestureRequiredPolicy) { 464 switches::autoplay::kUserGestureRequiredPolicy) {
465 prefs.autoplay_policy = AutoplayPolicy::kUserGestureRequired; 465 prefs.autoplay_policy = AutoplayPolicy::kUserGestureRequired;
466 } else if (autoplay_policy == 466 } else if (autoplay_policy ==
467 switches::autoplay::kUserGestureRequiredForCrossOriginPolicy) { 467 switches::autoplay::kUserGestureRequiredForCrossOriginPolicy) {
468 prefs.autoplay_policy = AutoplayPolicy::kUserGestureRequiredForCrossOrigin; 468 prefs.autoplay_policy = AutoplayPolicy::kUserGestureRequiredForCrossOrigin;
469 } else if (autoplay_policy ==
470 switches::autoplay::kDocumentUserActivationRequiredPolicy) {
471 prefs.autoplay_policy = AutoplayPolicy::kDocumentUserActivationRequired;
472 } else {
473 NOTREACHED();
469 } 474 }
470 475
471 const std::string touch_enabled_switch = 476 const std::string touch_enabled_switch =
472 command_line.HasSwitch(switches::kTouchEventFeatureDetection) 477 command_line.HasSwitch(switches::kTouchEventFeatureDetection)
473 ? command_line.GetSwitchValueASCII( 478 ? command_line.GetSwitchValueASCII(
474 switches::kTouchEventFeatureDetection) 479 switches::kTouchEventFeatureDetection)
475 : switches::kTouchEventFeatureDetectionAuto; 480 : switches::kTouchEventFeatureDetectionAuto;
476 prefs.touch_event_feature_detection_enabled = 481 prefs.touch_event_feature_detection_enabled =
477 (touch_enabled_switch == switches::kTouchEventFeatureDetectionAuto) 482 (touch_enabled_switch == switches::kTouchEventFeatureDetectionAuto)
478 ? (ui::GetTouchScreensAvailability() == 483 ? (ui::GetTouchScreensAvailability() ==
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } 973 }
969 974
970 void RenderViewHostImpl::ClosePageTimeout() { 975 void RenderViewHostImpl::ClosePageTimeout() {
971 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) 976 if (delegate_->ShouldIgnoreUnresponsiveRenderer())
972 return; 977 return;
973 978
974 ClosePageIgnoringUnloadEvents(); 979 ClosePageIgnoringUnloadEvents();
975 } 980 }
976 981
977 } // namespace content 982 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698