Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: Source/WebCore/page/Settings.cpp

Issue 13723004: Remove the ENABLE_TEXT_AUTOSIZING compile-time flag. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 #endif 154 #endif
155 #else 155 #else
156 static const bool defaultSmartInsertDeleteEnabled = true; 156 static const bool defaultSmartInsertDeleteEnabled = true;
157 static const bool defaultSelectTrailingWhitespaceEnabled = false; 157 static const bool defaultSelectTrailingWhitespaceEnabled = false;
158 #endif 158 #endif
159 159
160 Settings::Settings(Page* page) 160 Settings::Settings(Page* page)
161 : m_page(0) 161 : m_page(0)
162 , m_mediaTypeOverride("screen") 162 , m_mediaTypeOverride("screen")
163 , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage) 163 , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage)
164 #if ENABLE(TEXT_AUTOSIZING)
165 , m_textAutosizingFontScaleFactor(1) 164 , m_textAutosizingFontScaleFactor(1)
166 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP 165 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
167 , m_textAutosizingWindowSizeOverride(320, 480) 166 , m_textAutosizingWindowSizeOverride(320, 480)
168 , m_textAutosizingEnabled(true) 167 , m_textAutosizingEnabled(true)
169 #else 168 #else
170 , m_textAutosizingEnabled(false) 169 , m_textAutosizingEnabled(false)
171 #endif 170 #endif
172 #endif
173 SETTINGS_INITIALIZER_LIST 171 SETTINGS_INITIALIZER_LIST
174 , m_isJavaEnabled(false) 172 , m_isJavaEnabled(false)
175 , m_isJavaEnabledForLocalFiles(true) 173 , m_isJavaEnabledForLocalFiles(true)
176 , m_loadsImagesAutomatically(false) 174 , m_loadsImagesAutomatically(false)
177 , m_privateBrowsingEnabled(false) 175 , m_privateBrowsingEnabled(false)
178 , m_areImagesEnabled(true) 176 , m_areImagesEnabled(true)
179 , m_arePluginsEnabled(false) 177 , m_arePluginsEnabled(false)
180 , m_isScriptEnabled(false) 178 , m_isScriptEnabled(false)
181 , m_needsAdobeFrameReloadingQuirk(false) 179 , m_needsAdobeFrameReloadingQuirk(false)
182 , m_usesPageCache(false) 180 , m_usesPageCache(false)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 const AtomicString& Settings::pictographFontFamily(UScriptCode script) const 297 const AtomicString& Settings::pictographFontFamily(UScriptCode script) const
300 { 298 {
301 return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script); 299 return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script);
302 } 300 }
303 301
304 void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode s cript) 302 void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode s cript)
305 { 303 {
306 setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page); 304 setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page);
307 } 305 }
308 306
309 #if ENABLE(TEXT_AUTOSIZING)
310 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled) 307 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
311 { 308 {
312 if (m_textAutosizingEnabled == textAutosizingEnabled) 309 if (m_textAutosizingEnabled == textAutosizingEnabled)
313 return; 310 return;
314 311
315 m_textAutosizingEnabled = textAutosizingEnabled; 312 m_textAutosizingEnabled = textAutosizingEnabled;
316 m_page->setNeedsRecalcStyleInAllFrames(); 313 m_page->setNeedsRecalcStyleInAllFrames();
317 } 314 }
318 315
319 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing WindowSizeOverride) 316 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing WindowSizeOverride)
320 { 317 {
321 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) 318 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride)
322 return; 319 return;
323 320
324 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; 321 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride;
325 m_page->setNeedsRecalcStyleInAllFrames(); 322 m_page->setNeedsRecalcStyleInAllFrames();
326 } 323 }
327 324
328 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) 325 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
329 { 326 {
330 m_textAutosizingFontScaleFactor = fontScaleFactor; 327 m_textAutosizingFontScaleFactor = fontScaleFactor;
331 328
332 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res ize, or whether there is only one document per Settings instance? 329 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res ize, or whether there is only one document per Settings instance?
333 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave rseNext()) 330 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave rseNext())
334 frame->document()->textAutosizer()->recalculateMultipliers(); 331 frame->document()->textAutosizer()->recalculateMultipliers();
335 332
336 m_page->setNeedsRecalcStyleInAllFrames(); 333 m_page->setNeedsRecalcStyleInAllFrames();
337 } 334 }
338 335
339 #endif
340
341 void Settings::setResolutionOverride(const IntSize& densityPerInchOverride) 336 void Settings::setResolutionOverride(const IntSize& densityPerInchOverride)
342 { 337 {
343 if (m_resolutionDensityPerInchOverride == densityPerInchOverride) 338 if (m_resolutionDensityPerInchOverride == densityPerInchOverride)
344 return; 339 return;
345 340
346 m_resolutionDensityPerInchOverride = densityPerInchOverride; 341 m_resolutionDensityPerInchOverride = densityPerInchOverride;
347 m_page->setNeedsRecalcStyleInAllFrames(); 342 m_page->setNeedsRecalcStyleInAllFrames();
348 } 343 }
349 344
350 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) 345 void Settings::setMediaTypeOverride(const String& mediaTypeOverride)
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 void Settings::setHiddenPageCSSAnimationSuspensionEnabled(bool flag) 629 void Settings::setHiddenPageCSSAnimationSuspensionEnabled(bool flag)
635 { 630 {
636 if (m_hiddenPageCSSAnimationSuspensionEnabled == flag) 631 if (m_hiddenPageCSSAnimationSuspensionEnabled == flag)
637 return; 632 return;
638 m_hiddenPageCSSAnimationSuspensionEnabled = flag; 633 m_hiddenPageCSSAnimationSuspensionEnabled = flag;
639 m_page->hiddenPageCSSAnimationSuspensionStateChanged(); 634 m_page->hiddenPageCSSAnimationSuspensionStateChanged();
640 } 635 }
641 #endif 636 #endif
642 637
643 } // namespace WebCore 638 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698