OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserv
ed. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 #endif | 145 #endif |
146 #else | 146 #else |
147 static const bool defaultSmartInsertDeleteEnabled = true; | 147 static const bool defaultSmartInsertDeleteEnabled = true; |
148 static const bool defaultSelectTrailingWhitespaceEnabled = false; | 148 static const bool defaultSelectTrailingWhitespaceEnabled = false; |
149 #endif | 149 #endif |
150 | 150 |
151 Settings::Settings(Page* page) | 151 Settings::Settings(Page* page) |
152 : m_page(0) | 152 : m_page(0) |
153 , m_mediaTypeOverride("screen") | 153 , m_mediaTypeOverride("screen") |
154 , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage) | 154 , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage) |
155 #if ENABLE(TEXT_AUTOSIZING) | |
156 , m_textAutosizingFontScaleFactor(1) | 155 , m_textAutosizingFontScaleFactor(1) |
157 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP | 156 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP |
158 , m_textAutosizingWindowSizeOverride(320, 480) | 157 , m_textAutosizingWindowSizeOverride(320, 480) |
159 , m_textAutosizingEnabled(true) | 158 , m_textAutosizingEnabled(true) |
160 #else | 159 #else |
161 , m_textAutosizingEnabled(false) | 160 , m_textAutosizingEnabled(false) |
162 #endif | 161 #endif |
163 #endif | |
164 SETTINGS_INITIALIZER_LIST | 162 SETTINGS_INITIALIZER_LIST |
165 , m_isJavaEnabled(false) | 163 , m_isJavaEnabled(false) |
166 , m_isJavaEnabledForLocalFiles(true) | 164 , m_isJavaEnabledForLocalFiles(true) |
167 , m_loadsImagesAutomatically(false) | 165 , m_loadsImagesAutomatically(false) |
168 , m_privateBrowsingEnabled(false) | 166 , m_privateBrowsingEnabled(false) |
169 , m_areImagesEnabled(true) | 167 , m_areImagesEnabled(true) |
170 , m_arePluginsEnabled(false) | 168 , m_arePluginsEnabled(false) |
171 , m_isScriptEnabled(false) | 169 , m_isScriptEnabled(false) |
172 , m_needsAdobeFrameReloadingQuirk(false) | 170 , m_needsAdobeFrameReloadingQuirk(false) |
173 , m_usesPageCache(false) | 171 , m_usesPageCache(false) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 const AtomicString& Settings::pictographFontFamily(UScriptCode script) const | 281 const AtomicString& Settings::pictographFontFamily(UScriptCode script) const |
284 { | 282 { |
285 return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script); | 283 return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script); |
286 } | 284 } |
287 | 285 |
288 void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode s
cript) | 286 void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode s
cript) |
289 { | 287 { |
290 setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page); | 288 setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page); |
291 } | 289 } |
292 | 290 |
293 #if ENABLE(TEXT_AUTOSIZING) | |
294 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled) | 291 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled) |
295 { | 292 { |
296 if (m_textAutosizingEnabled == textAutosizingEnabled) | 293 if (m_textAutosizingEnabled == textAutosizingEnabled) |
297 return; | 294 return; |
298 | 295 |
299 m_textAutosizingEnabled = textAutosizingEnabled; | 296 m_textAutosizingEnabled = textAutosizingEnabled; |
300 m_page->setNeedsRecalcStyleInAllFrames(); | 297 m_page->setNeedsRecalcStyleInAllFrames(); |
301 } | 298 } |
302 | 299 |
303 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing
WindowSizeOverride) | 300 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing
WindowSizeOverride) |
304 { | 301 { |
305 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) | 302 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) |
306 return; | 303 return; |
307 | 304 |
308 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; | 305 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; |
309 m_page->setNeedsRecalcStyleInAllFrames(); | 306 m_page->setNeedsRecalcStyleInAllFrames(); |
310 } | 307 } |
311 | 308 |
312 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) | 309 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) |
313 { | 310 { |
314 m_textAutosizingFontScaleFactor = fontScaleFactor; | 311 m_textAutosizingFontScaleFactor = fontScaleFactor; |
315 | 312 |
316 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res
ize, or whether there is only one document per Settings instance? | 313 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res
ize, or whether there is only one document per Settings instance? |
317 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave
rseNext()) | 314 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave
rseNext()) |
318 frame->document()->textAutosizer()->recalculateMultipliers(); | 315 frame->document()->textAutosizer()->recalculateMultipliers(); |
319 | 316 |
320 m_page->setNeedsRecalcStyleInAllFrames(); | 317 m_page->setNeedsRecalcStyleInAllFrames(); |
321 } | 318 } |
322 | 319 |
323 #endif | |
324 | |
325 void Settings::setResolutionOverride(const IntSize& densityPerInchOverride) | 320 void Settings::setResolutionOverride(const IntSize& densityPerInchOverride) |
326 { | 321 { |
327 if (m_resolutionDensityPerInchOverride == densityPerInchOverride) | 322 if (m_resolutionDensityPerInchOverride == densityPerInchOverride) |
328 return; | 323 return; |
329 | 324 |
330 m_resolutionDensityPerInchOverride = densityPerInchOverride; | 325 m_resolutionDensityPerInchOverride = densityPerInchOverride; |
331 m_page->setNeedsRecalcStyleInAllFrames(); | 326 m_page->setNeedsRecalcStyleInAllFrames(); |
332 } | 327 } |
333 | 328 |
334 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) | 329 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 void Settings::setHiddenPageDOMTimerThrottlingEnabled(bool flag) | 580 void Settings::setHiddenPageDOMTimerThrottlingEnabled(bool flag) |
586 { | 581 { |
587 if (m_hiddenPageDOMTimerThrottlingEnabled == flag) | 582 if (m_hiddenPageDOMTimerThrottlingEnabled == flag) |
588 return; | 583 return; |
589 m_hiddenPageDOMTimerThrottlingEnabled = flag; | 584 m_hiddenPageDOMTimerThrottlingEnabled = flag; |
590 m_page->hiddenPageDOMTimerThrottlingStateChanged(); | 585 m_page->hiddenPageDOMTimerThrottlingStateChanged(); |
591 } | 586 } |
592 #endif | 587 #endif |
593 | 588 |
594 } // namespace WebCore | 589 } // namespace WebCore |
OLD | NEW |