| 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/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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 // Force preload=none and disable autoplay on older or low end Android | 1148 // Force preload=none and disable autoplay on older or low end Android |
| 1149 // platforms because their media pipelines are not stable enough to handle | 1149 // platforms because their media pipelines are not stable enough to handle |
| 1150 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826. | 1150 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826. |
| 1151 const bool is_low_end_device = | 1151 const bool is_low_end_device = |
| 1152 base::android::BuildInfo::GetInstance()->sdk_int() <= | 1152 base::android::BuildInfo::GetInstance()->sdk_int() <= |
| 1153 base::android::SDK_VERSION_JELLY_BEAN_MR2 || | 1153 base::android::SDK_VERSION_JELLY_BEAN_MR2 || |
| 1154 base::SysInfo::IsLowEndDevice(); | 1154 base::SysInfo::IsLowEndDevice(); |
| 1155 settings->setForcePreloadNoneForMediaElements(is_low_end_device); | 1155 settings->setForcePreloadNoneForMediaElements(is_low_end_device); |
| 1156 WebRuntimeFeatures::enableAutoplayMutedVideos( | 1156 WebRuntimeFeatures::enableAutoplayMutedVideos( |
| 1157 prefs.autoplay_muted_videos_enabled && !is_low_end_device); | 1157 prefs.autoplay_muted_videos_enabled && !is_low_end_device); |
| 1158 // On Android spellchecking is off by default and opt-in by means of the |
| 1159 // spellcheck attribute for better performance and battery saving, |
| 1160 // see crbug.com/646901. |
| 1161 settings->setSpellCheckEnabledByDefault(false); |
| 1158 #endif | 1162 #endif |
| 1159 | 1163 |
| 1160 settings->setAutoplayExperimentMode( | 1164 settings->setAutoplayExperimentMode( |
| 1161 blink::WebString::fromUTF8(prefs.autoplay_experiment_mode)); | 1165 blink::WebString::fromUTF8(prefs.autoplay_experiment_mode)); |
| 1162 | 1166 |
| 1163 settings->setViewportEnabled(prefs.viewport_enabled); | 1167 settings->setViewportEnabled(prefs.viewport_enabled); |
| 1164 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled); | 1168 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled); |
| 1165 settings->setShrinksViewportContentToFit( | 1169 settings->setShrinksViewportContentToFit( |
| 1166 prefs.shrinks_viewport_contents_to_fit); | 1170 prefs.shrinks_viewport_contents_to_fit); |
| 1167 settings->setViewportStyle( | 1171 settings->setViewportStyle( |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3033 return render_frame->focused_pepper_plugin(); | 3037 return render_frame->focused_pepper_plugin(); |
| 3034 } | 3038 } |
| 3035 frame = frame->traverseNext(false); | 3039 frame = frame->traverseNext(false); |
| 3036 } | 3040 } |
| 3037 | 3041 |
| 3038 return nullptr; | 3042 return nullptr; |
| 3039 } | 3043 } |
| 3040 #endif | 3044 #endif |
| 3041 | 3045 |
| 3042 } // namespace content | 3046 } // namespace content |
| OLD | NEW |