| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 #include <limits> | 29 #include <limits> |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 #include "core/fetch/ResourceFetcher.h" | 31 #include "core/fetch/ResourceFetcher.h" |
| 32 #include "core/inspector/InspectorInstrumentation.h" | 32 #include "core/inspector/InspectorInstrumentation.h" |
| 33 #include "core/page/Chrome.h" | 33 #include "core/page/Chrome.h" |
| 34 #include "core/page/Frame.h" | 34 #include "core/page/Frame.h" |
| 35 #include "core/page/FrameTree.h" | 35 #include "core/page/FrameTree.h" |
| 36 #include "core/page/FrameView.h" | 36 #include "core/page/FrameView.h" |
| 37 #include "core/page/Page.h" | 37 #include "core/page/Page.h" |
| 38 #include "core/platform/ScrollbarTheme.h" |
| 38 #include "core/rendering/TextAutosizer.h" | 39 #include "core/rendering/TextAutosizer.h" |
| 39 | 40 |
| 40 using namespace std; | 41 using namespace std; |
| 41 | 42 |
| 42 namespace WebCore { | 43 namespace WebCore { |
| 43 | 44 |
| 44 static void setImageLoadingSettings(Page* page) | 45 static void setImageLoadingSettings(Page* page) |
| 45 { | 46 { |
| 46 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->travers
eNext()) { | 47 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->travers
eNext()) { |
| 47 frame->document()->fetcher()->setImagesEnabled(page->settings().areImage
sEnabled()); | 48 frame->document()->fetcher()->setImagesEnabled(page->settings().areImage
sEnabled()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 69 static inline const AtomicString& getGenericFontFamilyForScript(const ScriptFont
FamilyMap& fontMap, UScriptCode script) | 70 static inline const AtomicString& getGenericFontFamilyForScript(const ScriptFont
FamilyMap& fontMap, UScriptCode script) |
| 70 { | 71 { |
| 71 ScriptFontFamilyMap::const_iterator it = fontMap.find(static_cast<int>(scrip
t)); | 72 ScriptFontFamilyMap::const_iterator it = fontMap.find(static_cast<int>(scrip
t)); |
| 72 if (it != fontMap.end()) | 73 if (it != fontMap.end()) |
| 73 return it->value; | 74 return it->value; |
| 74 if (script != USCRIPT_COMMON) | 75 if (script != USCRIPT_COMMON) |
| 75 return getGenericFontFamilyForScript(fontMap, USCRIPT_COMMON); | 76 return getGenericFontFamilyForScript(fontMap, USCRIPT_COMMON); |
| 76 return emptyAtom; | 77 return emptyAtom; |
| 77 } | 78 } |
| 78 | 79 |
| 79 bool Settings::gMockScrollbarsEnabled = false; | |
| 80 | |
| 81 // NOTEs | 80 // NOTEs |
| 82 // 1) EditingMacBehavior comprises builds on Mac; | 81 // 1) EditingMacBehavior comprises builds on Mac; |
| 83 // 2) EditingWindowsBehavior comprises builds on Windows; | 82 // 2) EditingWindowsBehavior comprises builds on Windows; |
| 84 // 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS/An
droid (and then abusing the terminology); | 83 // 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS/An
droid (and then abusing the terminology); |
| 85 // 4) EditingAndroidBehavior comprises Android builds. | 84 // 4) EditingAndroidBehavior comprises Android builds. |
| 86 // 99) MacEditingBehavior is used a fallback. | 85 // 99) MacEditingBehavior is used a fallback. |
| 87 static EditingBehaviorType editingBehaviorTypeForPlatform() | 86 static EditingBehaviorType editingBehaviorTypeForPlatform() |
| 88 { | 87 { |
| 89 return | 88 return |
| 90 #if OS(MACOSX) | 89 #if OS(MACOSX) |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 { | 338 { |
| 340 if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled) | 339 if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled) |
| 341 return; | 340 return; |
| 342 | 341 |
| 343 m_dnsPrefetchingEnabled = dnsPrefetchingEnabled; | 342 m_dnsPrefetchingEnabled = dnsPrefetchingEnabled; |
| 344 m_page->dnsPrefetchingStateChanged(); | 343 m_page->dnsPrefetchingStateChanged(); |
| 345 } | 344 } |
| 346 | 345 |
| 347 void Settings::setMockScrollbarsEnabled(bool flag) | 346 void Settings::setMockScrollbarsEnabled(bool flag) |
| 348 { | 347 { |
| 349 gMockScrollbarsEnabled = flag; | 348 ScrollbarTheme::setMockScrollbarsEnabled(flag); |
| 350 } | 349 } |
| 351 | 350 |
| 352 bool Settings::mockScrollbarsEnabled() | 351 bool Settings::mockScrollbarsEnabled() |
| 353 { | 352 { |
| 354 return gMockScrollbarsEnabled; | 353 return ScrollbarTheme::mockScrollbarsEnabled(); |
| 355 } | 354 } |
| 356 | 355 |
| 357 void Settings::setOpenGLMultisamplingEnabled(bool flag) | 356 void Settings::setOpenGLMultisamplingEnabled(bool flag) |
| 358 { | 357 { |
| 359 if (m_openGLMultisamplingEnabled == flag) | 358 if (m_openGLMultisamplingEnabled == flag) |
| 360 return; | 359 return; |
| 361 | 360 |
| 362 m_openGLMultisamplingEnabled = flag; | 361 m_openGLMultisamplingEnabled = flag; |
| 363 m_page->multisamplingChanged(); | 362 m_page->multisamplingChanged(); |
| 364 } | 363 } |
| 365 | 364 |
| 366 bool Settings::openGLMultisamplingEnabled() | 365 bool Settings::openGLMultisamplingEnabled() |
| 367 { | 366 { |
| 368 return m_openGLMultisamplingEnabled; | 367 return m_openGLMultisamplingEnabled; |
| 369 } | 368 } |
| 370 | 369 |
| 371 void Settings::setViewportEnabled(bool enabled) | 370 void Settings::setViewportEnabled(bool enabled) |
| 372 { | 371 { |
| 373 if (m_viewportEnabled == enabled) | 372 if (m_viewportEnabled == enabled) |
| 374 return; | 373 return; |
| 375 | 374 |
| 376 m_viewportEnabled = enabled; | 375 m_viewportEnabled = enabled; |
| 377 if (m_page->mainFrame()) | 376 if (m_page->mainFrame()) |
| 378 m_page->mainFrame()->document()->updateViewportDescription(); | 377 m_page->mainFrame()->document()->updateViewportDescription(); |
| 379 } | 378 } |
| 380 | 379 |
| 381 } // namespace WebCore | 380 } // namespace WebCore |
| OLD | NEW |