This source file includes following definitions.
- editingBehaviorTypeForPlatform
- m_textAutosizingEnabled
- create
- setDelegate
- invalidate
- setTextAutosizingEnabled
- setTextAutosizingWindowSizeOverride
- setMockScrollbarsEnabled
- mockScrollbarsEnabled
- setOpenGLMultisamplingEnabled
#include "config.h"
#include "core/frame/Settings.h"
#include "platform/scroll/ScrollbarTheme.h"
namespace WebCore {
static EditingBehaviorType editingBehaviorTypeForPlatform()
{
return
#if OS(MACOSX)
EditingMacBehavior
#elif OS(WIN)
EditingWindowsBehavior
#elif OS(ANDROID)
EditingAndroidBehavior
#else
EditingUnixBehavior
#endif
;
}
static const bool defaultUnifiedTextCheckerEnabled = false;
#if OS(MACOSX)
static const bool defaultSmartInsertDeleteEnabled = true;
#else
static const bool defaultSmartInsertDeleteEnabled = false;
#endif
#if OS(WIN)
static const bool defaultSelectTrailingWhitespaceEnabled = true;
#else
static const bool defaultSelectTrailingWhitespaceEnabled = false;
#endif
Settings::Settings()
: m_openGLMultisamplingEnabled(false)
#if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
, m_textAutosizingWindowSizeOverride(320, 480)
, m_textAutosizingEnabled(true)
#else
, m_textAutosizingEnabled(false)
#endif
SETTINGS_INITIALIZER_LIST
{
}
PassOwnPtr<Settings> Settings::create()
{
return adoptPtr(new Settings);
}
SETTINGS_SETTER_BODIES
void Settings::setDelegate(SettingsDelegate* delegate)
{
m_delegate = delegate;
}
void Settings::invalidate(SettingsDelegate::ChangeType changeType)
{
if (m_delegate)
m_delegate->settingsChanged(changeType);
}
void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
{
if (m_textAutosizingEnabled == textAutosizingEnabled)
return;
m_textAutosizingEnabled = textAutosizingEnabled;
invalidate(SettingsDelegate::TextAutosizingChange);
}
void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizingWindowSizeOverride)
{
if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride)
return;
m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride;
invalidate(SettingsDelegate::TextAutosizingChange);
}
void Settings::setMockScrollbarsEnabled(bool flag)
{
ScrollbarTheme::setMockScrollbarsEnabled(flag);
}
bool Settings::mockScrollbarsEnabled()
{
return ScrollbarTheme::mockScrollbarsEnabled();
}
void Settings::setOpenGLMultisamplingEnabled(bool flag)
{
if (m_openGLMultisamplingEnabled == flag)
return;
m_openGLMultisamplingEnabled = flag;
invalidate(SettingsDelegate::MultisamplingChange);
}
}