| 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 593 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 594 for (const std::string& setting : blink_settings) { | 594 for (const std::string& setting : blink_settings) { |
| 595 size_t pos = setting.find('='); | 595 size_t pos = setting.find('='); |
| 596 settings->setFromStrings( | 596 settings->setFromStrings( |
| 597 blink::WebString::fromLatin1(setting.substr(0, pos)), | 597 blink::WebString::fromLatin1(setting.substr(0, pos)), |
| 598 blink::WebString::fromLatin1( | 598 blink::WebString::fromLatin1( |
| 599 pos == std::string::npos ? "" : setting.substr(pos + 1))); | 599 pos == std::string::npos ? "" : setting.substr(pos + 1))); |
| 600 } | 600 } |
| 601 } | 601 } |
| 602 | 602 |
| 603 WebSettings::V8CacheStrategiesForCacheStorage |
| 604 GetV8CacheStrategiesForCacheStorage() { |
| 605 const base::CommandLine& command_line = |
| 606 *base::CommandLine::ForCurrentProcess(); |
| 607 std::string v8_cache_strategies = command_line.GetSwitchValueASCII( |
| 608 switches::kV8CacheStrategiesForCacheStorage); |
| 609 if (v8_cache_strategies.empty()) |
| 610 v8_cache_strategies = |
| 611 base::FieldTrialList::FindFullName("V8CacheStrategiesForCacheStorage"); |
| 612 if (v8_cache_strategies == "none") { |
| 613 return WebSettings::V8CacheStrategiesForCacheStorage::None; |
| 614 } else if (v8_cache_strategies == "normal") { |
| 615 return WebSettings::V8CacheStrategiesForCacheStorage::Normal; |
| 616 } else if (v8_cache_strategies == "aggressive") { |
| 617 return WebSettings::V8CacheStrategiesForCacheStorage::Aggressive; |
| 618 } else { |
| 619 return WebSettings::V8CacheStrategiesForCacheStorage::Default; |
| 620 } |
| 621 } |
| 622 |
| 603 } // namespace | 623 } // namespace |
| 604 | 624 |
| 605 RenderViewImpl::RenderViewImpl(CompositorDependencies* compositor_deps, | 625 RenderViewImpl::RenderViewImpl(CompositorDependencies* compositor_deps, |
| 606 const ViewMsg_New_Params& params) | 626 const ViewMsg_New_Params& params) |
| 607 : RenderWidget(compositor_deps, | 627 : RenderWidget(compositor_deps, |
| 608 blink::WebPopupTypeNone, | 628 blink::WebPopupTypeNone, |
| 609 params.initial_size.screen_info, | 629 params.initial_size.screen_info, |
| 610 params.swapped_out, | 630 params.swapped_out, |
| 611 params.hidden, | 631 params.hidden, |
| 612 params.never_visible), | 632 params.never_visible), |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 | 1051 |
| 1032 settings->setSmartInsertDeleteEnabled(prefs.smart_insert_delete_enabled); | 1052 settings->setSmartInsertDeleteEnabled(prefs.smart_insert_delete_enabled); |
| 1033 | 1053 |
| 1034 settings->setSpatialNavigationEnabled(prefs.spatial_navigation_enabled); | 1054 settings->setSpatialNavigationEnabled(prefs.spatial_navigation_enabled); |
| 1035 | 1055 |
| 1036 settings->setSelectionIncludesAltImageText(true); | 1056 settings->setSelectionIncludesAltImageText(true); |
| 1037 | 1057 |
| 1038 settings->setV8CacheOptions( | 1058 settings->setV8CacheOptions( |
| 1039 static_cast<WebSettings::V8CacheOptions>(prefs.v8_cache_options)); | 1059 static_cast<WebSettings::V8CacheOptions>(prefs.v8_cache_options)); |
| 1040 | 1060 |
| 1061 settings->setV8CacheStrategiesForCacheStorage( |
| 1062 GetV8CacheStrategiesForCacheStorage()); |
| 1063 |
| 1041 settings->setImageAnimationPolicy( | 1064 settings->setImageAnimationPolicy( |
| 1042 static_cast<WebSettings::ImageAnimationPolicy>(prefs.animation_policy)); | 1065 static_cast<WebSettings::ImageAnimationPolicy>(prefs.animation_policy)); |
| 1043 | 1066 |
| 1044 settings->setPresentationRequiresUserGesture( | 1067 settings->setPresentationRequiresUserGesture( |
| 1045 prefs.user_gesture_required_for_presentation); | 1068 prefs.user_gesture_required_for_presentation); |
| 1046 | 1069 |
| 1047 settings->setTextTrackMarginPercentage(prefs.text_track_margin_percentage); | 1070 settings->setTextTrackMarginPercentage(prefs.text_track_margin_percentage); |
| 1048 | 1071 |
| 1049 // Needs to happen before setIgnoreVIewportTagScaleLimits below. | 1072 // Needs to happen before setIgnoreVIewportTagScaleLimits below. |
| 1050 web_view->setDefaultPageScaleLimits( | 1073 web_view->setDefaultPageScaleLimits( |
| (...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3424 if (IsUseZoomForDSFEnabled()) { | 3447 if (IsUseZoomForDSFEnabled()) { |
| 3425 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3448 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3426 } else { | 3449 } else { |
| 3427 webview()->setDeviceScaleFactor(device_scale_factor_); | 3450 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3428 } | 3451 } |
| 3429 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3452 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3430 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3453 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3431 } | 3454 } |
| 3432 | 3455 |
| 3433 } // namespace content | 3456 } // namespace content |
| OLD | NEW |