| 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826. | 1036 // concurrent elements. See http://crbug.com/612909, http://crbug.com/622826. |
| 1037 const bool is_low_end_device = | 1037 const bool is_low_end_device = |
| 1038 base::android::BuildInfo::GetInstance()->sdk_int() <= | 1038 base::android::BuildInfo::GetInstance()->sdk_int() <= |
| 1039 base::android::SDK_VERSION_JELLY_BEAN_MR2 || | 1039 base::android::SDK_VERSION_JELLY_BEAN_MR2 || |
| 1040 base::SysInfo::IsLowEndDevice(); | 1040 base::SysInfo::IsLowEndDevice(); |
| 1041 // TODO(mlamouri): rename this setting "isLowEndDevice". | 1041 // TODO(mlamouri): rename this setting "isLowEndDevice". |
| 1042 settings->setForcePreloadNoneForMediaElements(is_low_end_device); | 1042 settings->setForcePreloadNoneForMediaElements(is_low_end_device); |
| 1043 | 1043 |
| 1044 WebRuntimeFeatures::enableVideoFullscreenOrientationLock( | 1044 WebRuntimeFeatures::enableVideoFullscreenOrientationLock( |
| 1045 prefs.video_fullscreen_orientation_lock_enabled); | 1045 prefs.video_fullscreen_orientation_lock_enabled); |
| 1046 #endif | 1046 #else // defined(OS_ANDROID) |
| 1047 settings->setCrossOriginMediaPlaybackRequiresUserGesture( |
| 1048 prefs.cross_origin_media_playback_requires_user_gesture); |
| 1049 #endif // defined(OS_ANDROID) |
| 1047 | 1050 |
| 1048 settings->setViewportEnabled(prefs.viewport_enabled); | 1051 settings->setViewportEnabled(prefs.viewport_enabled); |
| 1049 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled); | 1052 settings->setViewportMetaEnabled(prefs.viewport_meta_enabled); |
| 1050 settings->setShrinksViewportContentToFit( | 1053 settings->setShrinksViewportContentToFit( |
| 1051 prefs.shrinks_viewport_contents_to_fit); | 1054 prefs.shrinks_viewport_contents_to_fit); |
| 1052 settings->setViewportStyle( | 1055 settings->setViewportStyle( |
| 1053 static_cast<blink::WebViewportStyle>(prefs.viewport_style)); | 1056 static_cast<blink::WebViewportStyle>(prefs.viewport_style)); |
| 1054 | 1057 |
| 1055 settings->setLoadWithOverviewMode(prefs.initialize_at_minimum_page_scale); | 1058 settings->setLoadWithOverviewMode(prefs.initialize_at_minimum_page_scale); |
| 1056 settings->setMainFrameResizesAreOrientationChanges( | 1059 settings->setMainFrameResizesAreOrientationChanges( |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2815 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2818 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2816 } | 2819 } |
| 2817 | 2820 |
| 2818 std::unique_ptr<InputEventAck> ack( | 2821 std::unique_ptr<InputEventAck> ack( |
| 2819 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, | 2822 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, |
| 2820 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2823 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2821 OnInputEventAck(std::move(ack)); | 2824 OnInputEventAck(std::move(ack)); |
| 2822 } | 2825 } |
| 2823 | 2826 |
| 2824 } // namespace content | 2827 } // namespace content |
| OLD | NEW |