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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2472773005: Remove autoplay-muted-videos feature flag. (Closed)
Patch Set: Created 4 years, 1 month 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 | « content/public/common/web_preferences.cc ('k') | no next file » | 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 settings->setIgnoreMainFrameOverflowHiddenQuirk( 1129 settings->setIgnoreMainFrameOverflowHiddenQuirk(
1130 prefs.ignore_main_frame_overflow_hidden_quirk); 1130 prefs.ignore_main_frame_overflow_hidden_quirk);
1131 settings->setReportScreenSizeInPhysicalPixelsQuirk( 1131 settings->setReportScreenSizeInPhysicalPixelsQuirk(
1132 prefs.report_screen_size_in_physical_pixels_quirk); 1132 prefs.report_screen_size_in_physical_pixels_quirk);
1133 settings->setShouldReuseGlobalForUnownedMainFrame( 1133 settings->setShouldReuseGlobalForUnownedMainFrame(
1134 prefs.resue_global_for_unowned_main_frame); 1134 prefs.resue_global_for_unowned_main_frame);
1135 settings->setProgressBarCompletion( 1135 settings->setProgressBarCompletion(
1136 static_cast<WebSettings::ProgressBarCompletion>( 1136 static_cast<WebSettings::ProgressBarCompletion>(
1137 prefs.progress_bar_completion)); 1137 prefs.progress_bar_completion));
1138 settings->setPreferHiddenVolumeControls(true); 1138 settings->setPreferHiddenVolumeControls(true);
1139 settings->setSpellCheckEnabledByDefault(prefs.spellcheck_enabled_by_default);
1139 1140
1140 // Force preload=none and disable autoplay on older or low end Android 1141 // Force preload=none and disable autoplay on older or low end Android
1141 // platforms because their media pipelines are not stable enough to handle 1142 // platforms because their media pipelines are not stable enough to handle
1142 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826. 1143 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826.
1143 const bool is_low_end_device = 1144 const bool is_low_end_device =
1144 base::android::BuildInfo::GetInstance()->sdk_int() <= 1145 base::android::BuildInfo::GetInstance()->sdk_int() <=
1145 base::android::SDK_VERSION_JELLY_BEAN_MR2 || 1146 base::android::SDK_VERSION_JELLY_BEAN_MR2 ||
1146 base::SysInfo::IsLowEndDevice(); 1147 base::SysInfo::IsLowEndDevice();
1148 // TODO(mlamouri): rename this setting "isLowEndDevice".
1147 settings->setForcePreloadNoneForMediaElements(is_low_end_device); 1149 settings->setForcePreloadNoneForMediaElements(is_low_end_device);
1148 WebRuntimeFeatures::enableAutoplayMutedVideos(
1149 prefs.autoplay_muted_videos_enabled && !is_low_end_device);
mlamouri (slow - plz ping) 2016/11/04 16:18:54 Note that autoplay muted is always enabled because
1150 settings->setSpellCheckEnabledByDefault(prefs.spellcheck_enabled_by_default);
1151 #endif 1150 #endif
1152 1151
1153 settings->setAutoplayExperimentMode( 1152 settings->setAutoplayExperimentMode(
1154 blink::WebString::fromUTF8(prefs.autoplay_experiment_mode)); 1153 blink::WebString::fromUTF8(prefs.autoplay_experiment_mode));
1155 1154
1156 settings->setViewportEnabled(prefs.viewport_enabled); 1155 settings->setViewportEnabled(prefs.viewport_enabled);
1157 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled); 1156 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled);
1158 settings->setShrinksViewportContentToFit( 1157 settings->setShrinksViewportContentToFit(
1159 prefs.shrinks_viewport_contents_to_fit); 1158 prefs.shrinks_viewport_contents_to_fit);
1160 settings->setViewportStyle( 1159 settings->setViewportStyle(
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after
2995 NotifyInputEventHandled(input_event->type, 2994 NotifyInputEventHandled(input_event->type,
2996 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2995 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2997 } 2996 }
2998 2997
2999 std::unique_ptr<InputEventAck> ack( 2998 std::unique_ptr<InputEventAck> ack(
3000 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2999 new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
3001 OnInputEventAck(std::move(ack)); 3000 OnInputEventAck(std::move(ack));
3002 } 3001 }
3003 3002
3004 } // namespace content 3003 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/web_preferences.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698