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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 Settings::Settings(Page* page) | 113 Settings::Settings(Page* page) |
114 : m_page(0) | 114 : m_page(0) |
115 , m_mediaTypeOverride("screen") | 115 , m_mediaTypeOverride("screen") |
116 , m_textAutosizingFontScaleFactor(1) | 116 , m_textAutosizingFontScaleFactor(1) |
117 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP | 117 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP |
118 , m_textAutosizingWindowSizeOverride(320, 480) | 118 , m_textAutosizingWindowSizeOverride(320, 480) |
119 , m_textAutosizingEnabled(true) | 119 , m_textAutosizingEnabled(true) |
120 #else | 120 #else |
121 , m_textAutosizingEnabled(false) | 121 , m_textAutosizingEnabled(false) |
122 #endif | 122 #endif |
123 , m_deviceScaleAdjustment(1.0f) | |
123 , m_useWideViewport(true) | 124 , m_useWideViewport(true) |
124 , m_loadWithOverviewMode(true) | 125 , m_loadWithOverviewMode(true) |
125 SETTINGS_INITIALIZER_LIST | 126 SETTINGS_INITIALIZER_LIST |
126 , m_isJavaEnabled(false) | 127 , m_isJavaEnabled(false) |
127 , m_loadsImagesAutomatically(false) | 128 , m_loadsImagesAutomatically(false) |
128 , m_areImagesEnabled(true) | 129 , m_areImagesEnabled(true) |
129 , m_arePluginsEnabled(false) | 130 , m_arePluginsEnabled(false) |
130 , m_isScriptEnabled(false) | 131 , m_isScriptEnabled(false) |
131 , m_dnsPrefetchingEnabled(false) | 132 , m_dnsPrefetchingEnabled(false) |
132 , m_touchEventEmulationEnabled(false) | 133 , m_touchEventEmulationEnabled(false) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 void Settings::setLoadWithOverviewMode(bool loadWithOverviewMode) | 252 void Settings::setLoadWithOverviewMode(bool loadWithOverviewMode) |
252 { | 253 { |
253 if (m_loadWithOverviewMode == loadWithOverviewMode) | 254 if (m_loadWithOverviewMode == loadWithOverviewMode) |
254 return; | 255 return; |
255 | 256 |
256 m_loadWithOverviewMode = loadWithOverviewMode; | 257 m_loadWithOverviewMode = loadWithOverviewMode; |
257 if (m_page->mainFrame()) | 258 if (m_page->mainFrame()) |
258 m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame() ->document()->viewportDescription()); | 259 m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame() ->document()->viewportDescription()); |
259 } | 260 } |
260 | 261 |
261 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) | 262 void Settings::recalculateAutosizingMultipliers() |
pdr.
2013/10/29 02:04:44
Confusingly, autosizing and text autosizing are di
skobes
2013/10/29 17:43:32
Done.
| |
262 { | 263 { |
263 m_textAutosizingFontScaleFactor = fontScaleFactor; | |
264 | |
265 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res ize, or whether there is only one document per Settings instance? | 264 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res ize, or whether there is only one document per Settings instance? |
266 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) | 265 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) |
267 frame->document()->textAutosizer()->recalculateMultipliers(); | 266 frame->document()->textAutosizer()->recalculateMultipliers(); |
268 | 267 |
269 m_page->setNeedsRecalcStyleInAllFrames(); | 268 m_page->setNeedsRecalcStyleInAllFrames(); |
270 } | 269 } |
271 | 270 |
271 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) | |
272 { | |
273 m_textAutosizingFontScaleFactor = fontScaleFactor; | |
274 recalculateAutosizingMultipliers(); | |
275 } | |
276 | |
277 void Settings::setDeviceScaleAdjustment(float deviceScaleAdjustment) | |
278 { | |
279 m_deviceScaleAdjustment = deviceScaleAdjustment; | |
280 recalculateAutosizingMultipliers(); | |
281 } | |
282 | |
272 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) | 283 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) |
273 { | 284 { |
274 if (m_mediaTypeOverride == mediaTypeOverride) | 285 if (m_mediaTypeOverride == mediaTypeOverride) |
275 return; | 286 return; |
276 | 287 |
277 m_mediaTypeOverride = mediaTypeOverride; | 288 m_mediaTypeOverride = mediaTypeOverride; |
278 | 289 |
279 Frame* mainFrame = m_page->mainFrame(); | 290 Frame* mainFrame = m_page->mainFrame(); |
280 ASSERT(mainFrame); | 291 ASSERT(mainFrame); |
281 FrameView* view = mainFrame->view(); | 292 FrameView* view = mainFrame->view(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 { | 397 { |
387 if (m_viewportEnabled == enabled) | 398 if (m_viewportEnabled == enabled) |
388 return; | 399 return; |
389 | 400 |
390 m_viewportEnabled = enabled; | 401 m_viewportEnabled = enabled; |
391 if (m_page->mainFrame()) | 402 if (m_page->mainFrame()) |
392 m_page->mainFrame()->document()->updateViewportDescription(); | 403 m_page->mainFrame()->document()->updateViewportDescription(); |
393 } | 404 } |
394 | 405 |
395 } // namespace WebCore | 406 } // namespace WebCore |
OLD | NEW |