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

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

Issue 2472773005: Remove autoplay-muted-videos feature flag. (Closed)
Patch Set: update java code 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 settings->setIgnoreMainFrameOverflowHiddenQuirk( 1010 settings->setIgnoreMainFrameOverflowHiddenQuirk(
1011 prefs.ignore_main_frame_overflow_hidden_quirk); 1011 prefs.ignore_main_frame_overflow_hidden_quirk);
1012 settings->setReportScreenSizeInPhysicalPixelsQuirk( 1012 settings->setReportScreenSizeInPhysicalPixelsQuirk(
1013 prefs.report_screen_size_in_physical_pixels_quirk); 1013 prefs.report_screen_size_in_physical_pixels_quirk);
1014 settings->setShouldReuseGlobalForUnownedMainFrame( 1014 settings->setShouldReuseGlobalForUnownedMainFrame(
1015 prefs.resue_global_for_unowned_main_frame); 1015 prefs.resue_global_for_unowned_main_frame);
1016 settings->setProgressBarCompletion( 1016 settings->setProgressBarCompletion(
1017 static_cast<WebSettings::ProgressBarCompletion>( 1017 static_cast<WebSettings::ProgressBarCompletion>(
1018 prefs.progress_bar_completion)); 1018 prefs.progress_bar_completion));
1019 settings->setPreferHiddenVolumeControls(true); 1019 settings->setPreferHiddenVolumeControls(true);
1020 settings->setSpellCheckEnabledByDefault(prefs.spellcheck_enabled_by_default);
1020 1021
1021 // Force preload=none and disable autoplay on older or low end Android 1022 // Force preload=none and disable autoplay on older or low end Android
1022 // platforms because their media pipelines are not stable enough to handle 1023 // platforms because their media pipelines are not stable enough to handle
1023 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826. 1024 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826.
1024 const bool is_low_end_device = 1025 const bool is_low_end_device =
1025 base::android::BuildInfo::GetInstance()->sdk_int() <= 1026 base::android::BuildInfo::GetInstance()->sdk_int() <=
1026 base::android::SDK_VERSION_JELLY_BEAN_MR2 || 1027 base::android::SDK_VERSION_JELLY_BEAN_MR2 ||
1027 base::SysInfo::IsLowEndDevice(); 1028 base::SysInfo::IsLowEndDevice();
1029 // TODO(mlamouri): rename this setting "isLowEndDevice".
1028 settings->setForcePreloadNoneForMediaElements(is_low_end_device); 1030 settings->setForcePreloadNoneForMediaElements(is_low_end_device);
1029 WebRuntimeFeatures::enableAutoplayMutedVideos(
1030 prefs.autoplay_muted_videos_enabled && !is_low_end_device);
1031 settings->setSpellCheckEnabledByDefault(prefs.spellcheck_enabled_by_default);
1032 #endif 1031 #endif
1033 1032
1034 settings->setAutoplayExperimentMode( 1033 settings->setAutoplayExperimentMode(
1035 blink::WebString::fromUTF8(prefs.autoplay_experiment_mode)); 1034 blink::WebString::fromUTF8(prefs.autoplay_experiment_mode));
1036 1035
1037 settings->setViewportEnabled(prefs.viewport_enabled); 1036 settings->setViewportEnabled(prefs.viewport_enabled);
1038 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled); 1037 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled);
1039 settings->setShrinksViewportContentToFit( 1038 settings->setShrinksViewportContentToFit(
1040 prefs.shrinks_viewport_contents_to_fit); 1039 prefs.shrinks_viewport_contents_to_fit);
1041 settings->setViewportStyle( 1040 settings->setViewportStyle(
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2791 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2793 } 2792 }
2794 2793
2795 std::unique_ptr<InputEventAck> ack( 2794 std::unique_ptr<InputEventAck> ack(
2796 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, 2795 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type,
2797 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2796 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2798 OnInputEventAck(std::move(ack)); 2797 OnInputEventAck(std::move(ack));
2799 } 2798 }
2800 2799
2801 } // namespace content 2800 } // 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