OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 , m_originalCSP(RuntimeEnabledFeatures::experimentalContentSecurityPolicyFea
turesEnabled()) | 64 , m_originalCSP(RuntimeEnabledFeatures::experimentalContentSecurityPolicyFea
turesEnabled()) |
65 , m_originalOverlayScrollbarsEnabled(RuntimeEnabledFeatures::overlayScrollba
rsEnabled()) | 65 , m_originalOverlayScrollbarsEnabled(RuntimeEnabledFeatures::overlayScrollba
rsEnabled()) |
66 , m_originalEditingBehavior(settings->editingBehaviorType()) | 66 , m_originalEditingBehavior(settings->editingBehaviorType()) |
67 , m_originalTextAutosizingEnabled(settings->textAutosizingEnabled()) | 67 , m_originalTextAutosizingEnabled(settings->textAutosizingEnabled()) |
68 , m_originalTextAutosizingWindowSizeOverride(settings->textAutosizingWindowS
izeOverride()) | 68 , m_originalTextAutosizingWindowSizeOverride(settings->textAutosizingWindowS
izeOverride()) |
69 , m_originalAccessibilityFontScaleFactor(settings->accessibilityFontScaleFac
tor()) | 69 , m_originalAccessibilityFontScaleFactor(settings->accessibilityFontScaleFac
tor()) |
70 , m_originalMediaTypeOverride(settings->mediaTypeOverride()) | 70 , m_originalMediaTypeOverride(settings->mediaTypeOverride()) |
71 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled()) | 71 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled()) |
72 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri
buteAwareFormControlUIEnabled()) | 72 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri
buteAwareFormControlUIEnabled()) |
73 , m_imagesEnabled(settings->imagesEnabled()) | 73 , m_imagesEnabled(settings->imagesEnabled()) |
74 , m_shouldDisplaySubtitles(settings->shouldDisplaySubtitles()) | |
75 , m_shouldDisplayCaptions(settings->shouldDisplayCaptions()) | |
76 , m_shouldDisplayTextDescriptions(settings->shouldDisplayTextDescriptions()) | |
77 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL()) | 74 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL()) |
78 , m_originalCompositorDrivenAcceleratedScrollEnabled(settings->compositorDri
venAcceleratedScrollingEnabled()) | 75 , m_originalCompositorDrivenAcceleratedScrollEnabled(settings->compositorDri
venAcceleratedScrollingEnabled()) |
79 , m_originalLayerSquashingEnabled(settings->layerSquashingEnabled()) | 76 , m_originalLayerSquashingEnabled(settings->layerSquashingEnabled()) |
80 , m_originalPasswordGenerationDecorationEnabled(settings->passwordGeneration
DecorationEnabled()) | 77 , m_originalPasswordGenerationDecorationEnabled(settings->passwordGeneration
DecorationEnabled()) |
81 { | 78 { |
82 } | 79 } |
83 | 80 |
84 void InternalSettings::Backup::restoreTo(Settings* settings) | 81 void InternalSettings::Backup::restoreTo(Settings* settings) |
85 { | 82 { |
86 RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabl
ed); | 83 RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabl
ed); |
87 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut
horShadowDOMForAnyElementEnabled); | 84 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut
horShadowDOMForAnyElementEnabled); |
88 RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped); | 85 RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped); |
89 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled(
m_originalCSP); | 86 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled(
m_originalCSP); |
90 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_originalOverlayScrollb
arsEnabled); | 87 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_originalOverlayScrollb
arsEnabled); |
91 settings->setEditingBehaviorType(m_originalEditingBehavior); | 88 settings->setEditingBehaviorType(m_originalEditingBehavior); |
92 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled); | 89 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled); |
93 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow
SizeOverride); | 90 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow
SizeOverride); |
94 settings->setAccessibilityFontScaleFactor(m_originalAccessibilityFontScaleFa
ctor); | 91 settings->setAccessibilityFontScaleFactor(m_originalAccessibilityFontScaleFa
ctor); |
95 settings->setMediaTypeOverride(m_originalMediaTypeOverride); | 92 settings->setMediaTypeOverride(m_originalMediaTypeOverride); |
96 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled); | 93 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled); |
97 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr
ibuteAwareFormControlUIEnabled); | 94 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr
ibuteAwareFormControlUIEnabled); |
98 settings->setImagesEnabled(m_imagesEnabled); | 95 settings->setImagesEnabled(m_imagesEnabled); |
99 settings->setShouldDisplaySubtitles(m_shouldDisplaySubtitles); | |
100 settings->setShouldDisplayCaptions(m_shouldDisplayCaptions); | |
101 settings->setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions); | |
102 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL); | 96 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL); |
103 settings->setCompositorDrivenAcceleratedScrollingEnabled(m_originalComposito
rDrivenAcceleratedScrollEnabled); | 97 settings->setCompositorDrivenAcceleratedScrollingEnabled(m_originalComposito
rDrivenAcceleratedScrollEnabled); |
104 settings->setLayerSquashingEnabled(m_originalLayerSquashingEnabled); | 98 settings->setLayerSquashingEnabled(m_originalLayerSquashingEnabled); |
105 settings->setPasswordGenerationDecorationEnabled(m_originalPasswordGeneratio
nDecorationEnabled); | 99 settings->setPasswordGenerationDecorationEnabled(m_originalPasswordGeneratio
nDecorationEnabled); |
106 settings->genericFontFamilySettings().reset(); | 100 settings->genericFontFamilySettings().reset(); |
107 } | 101 } |
108 | 102 |
109 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted | 103 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted |
110 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. | 104 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. |
111 // Instead, we manually make InternalSettings supplement Page. | 105 // Instead, we manually make InternalSettings supplement Page. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 settings()->setDefaultVideoPosterURL(url); | 340 settings()->setDefaultVideoPosterURL(url); |
347 } | 341 } |
348 | 342 |
349 void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce
ptionState& exceptionState) | 343 void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce
ptionState& exceptionState) |
350 { | 344 { |
351 InternalSettingsGuardForSettings(); | 345 InternalSettingsGuardForSettings(); |
352 settings()->setPasswordGenerationDecorationEnabled(enabled); | 346 settings()->setPasswordGenerationDecorationEnabled(enabled); |
353 } | 347 } |
354 | 348 |
355 } | 349 } |
OLD | NEW |