| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/page/Page.h" | 37 #include "core/page/Page.h" |
| 38 #include "core/platform/ScrollbarTheme.h" | 38 #include "core/platform/ScrollbarTheme.h" |
| 39 #include "core/rendering/TextAutosizer.h" | 39 #include "core/rendering/TextAutosizer.h" |
| 40 | 40 |
| 41 using namespace std; | 41 using namespace std; |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 | 44 |
| 45 static void setImageLoadingSettings(Page* page) | 45 static void setImageLoadingSettings(Page* page) |
| 46 { | 46 { |
| 47 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->travers
eNext()) { | 47 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverse
Next()) { |
| 48 frame->document()->fetcher()->setImagesEnabled(page->settings().areImage
sEnabled()); | 48 frame->document()->fetcher()->setImagesEnabled(page->settings().areImage
sEnabled()); |
| 49 frame->document()->fetcher()->setAutoLoadImages(page->settings().loadsIm
agesAutomatically()); | 49 frame->document()->fetcher()->setAutoLoadImages(page->settings().loadsIm
agesAutomatically()); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Sets the entry in the font map for the given script. If family is the empty s
tring, removes the entry instead. | 53 // Sets the entry in the font map for the given script. If family is the empty s
tring, removes the entry instead. |
| 54 static inline void setGenericFontFamilyMap(ScriptFontFamilyMap& fontMap, const A
tomicString& family, UScriptCode script, Page* page) | 54 static inline void setGenericFontFamilyMap(ScriptFontFamilyMap& fontMap, const A
tomicString& family, UScriptCode script, Page* page) |
| 55 { | 55 { |
| 56 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); | 56 ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script)); |
| 57 if (family.isEmpty()) { | 57 if (family.isEmpty()) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 m_loadWithOverviewMode = loadWithOverviewMode; | 256 m_loadWithOverviewMode = loadWithOverviewMode; |
| 257 if (m_page->mainFrame()) | 257 if (m_page->mainFrame()) |
| 258 m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame()
->document()->viewportDescription()); | 258 m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame()
->document()->viewportDescription()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) | 261 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) |
| 262 { | 262 { |
| 263 m_textAutosizingFontScaleFactor = fontScaleFactor; | 263 m_textAutosizingFontScaleFactor = fontScaleFactor; |
| 264 | 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? | 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? |
| 266 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave
rseNext()) | 266 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) |
| 267 frame->document()->textAutosizer()->recalculateMultipliers(); | 267 frame->document()->textAutosizer()->recalculateMultipliers(); |
| 268 | 268 |
| 269 m_page->setNeedsRecalcStyleInAllFrames(); | 269 m_page->setNeedsRecalcStyleInAllFrames(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) | 272 void Settings::setMediaTypeOverride(const String& mediaTypeOverride) |
| 273 { | 273 { |
| 274 if (m_mediaTypeOverride == mediaTypeOverride) | 274 if (m_mediaTypeOverride == mediaTypeOverride) |
| 275 return; | 275 return; |
| 276 | 276 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 { | 386 { |
| 387 if (m_viewportEnabled == enabled) | 387 if (m_viewportEnabled == enabled) |
| 388 return; | 388 return; |
| 389 | 389 |
| 390 m_viewportEnabled = enabled; | 390 m_viewportEnabled = enabled; |
| 391 if (m_page->mainFrame()) | 391 if (m_page->mainFrame()) |
| 392 m_page->mainFrame()->document()->updateViewportDescription(); | 392 m_page->mainFrame()->document()->updateViewportDescription(); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace WebCore | 395 } // namespace WebCore |
| OLD | NEW |