summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-11-24 14:22:22 -0800
committerGrace Kloba <klobag@google.com>2009-12-02 11:13:36 -0800
commit8ec4217018562da37ecf4144e582fa848b807263 (patch)
treee917a4c71fff6f8c4d065c130ba5bc1486d64e60 /WebCore
parent73b03f71b87666e532e997c6bcd3eb6a4fc3228d (diff)
downloadexternal_webkit-8ec4217018562da37ecf4144e582fa848b807263.zip
external_webkit-8ec4217018562da37ecf4144e582fa848b807263.tar.gz
external_webkit-8ec4217018562da37ecf4144e582fa848b807263.tar.bz2
Enable WebKit page cache through WebSettings.
Add setXX() for the meta data in Settings. Add CachedFramePlatformDataAndroid to preserve the state for the cachedFrame. http://b/issue?id=2284168
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/page/Settings.cpp68
-rw-r--r--WebCore/page/Settings.h19
-rw-r--r--WebCore/platform/android/SystemTimeAndroid.cpp5
3 files changed, 90 insertions, 2 deletions
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index d848e1c..3964d74 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -521,6 +521,74 @@ void Settings::setMetadataSettings(const String& key, const String& value)
}
}
}
+
+void Settings::setViewportWidth(int width)
+{
+ if (width < 0 || width > 10000)
+ m_viewport_width = -1;
+ else
+ m_viewport_width = width;
+}
+
+void Settings::setViewportHeight(int height)
+{
+ if (height < 0 || height > 10000)
+ m_viewport_height = -1;
+ else
+ m_viewport_height = height;
+}
+
+void Settings::setViewportInitialScale(int scale)
+{
+ if (scale < 1 || scale > 1000)
+ m_viewport_initial_scale = 0;
+ else
+ m_viewport_initial_scale = scale;
+}
+
+void Settings::setViewportMinimumScale(int scale)
+{
+ if (scale < 1 || scale > 1000)
+ m_viewport_minimum_scale = 0;
+ else
+ m_viewport_minimum_scale = scale;
+}
+
+void Settings::setViewportMaximumScale(int scale)
+{
+ if (scale < 1 || scale > 1000)
+ m_viewport_maximum_scale = 0;
+ else
+ m_viewport_maximum_scale = scale;
+}
+
+void Settings::setViewportUserScalable(bool scalable)
+{
+ m_viewport_user_scalable = scalable;
+}
+
+void Settings::setViewportTargetDensityDpi(int dpi)
+{
+ if (dpi < 0 || dpi > 400)
+ m_viewport_target_densitydpi = -1;
+ else
+ m_viewport_target_densitydpi = dpi;
+}
+
+void Settings::setFormatDetectionAddress(bool detect)
+{
+ m_format_detection_address = detect;
+}
+
+void Settings::setFormatDetectionEmail(bool detect)
+{
+ m_format_detection_email = detect;
+}
+
+void Settings::setFormatDetectionTelephone(bool detect)
+{
+ m_format_detection_telephone = detect;
+}
#endif
void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled)
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index b2eb7fa..de1030d 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -226,15 +226,34 @@ namespace WebCore {
void resetMetadataSettings();
void setMetadataSettings(const String& key, const String& value);
+ void setViewportWidth(int);
int viewportWidth() const { return m_viewport_width; }
+
+ void setViewportHeight(int);
int viewportHeight() const { return m_viewport_height; }
+
+ void setViewportInitialScale(int);
int viewportInitialScale() const { return m_viewport_initial_scale; }
+
+ void setViewportMinimumScale(int);
int viewportMinimumScale() const { return m_viewport_minimum_scale; }
+
+ void setViewportMaximumScale(int);
int viewportMaximumScale() const { return m_viewport_maximum_scale; }
+
+ void setViewportUserScalable(bool);
bool viewportUserScalable() const { return m_viewport_user_scalable; }
+
+ void setViewportTargetDensityDpi(int);
int viewportTargetDensityDpi() const { return m_viewport_target_densitydpi; }
+
+ void setFormatDetectionAddress(bool);
bool formatDetectionAddress() const { return m_format_detection_address; }
+
+ void setFormatDetectionEmail(bool);
bool formatDetectionEmail() const { return m_format_detection_email; }
+
+ void setFormatDetectionTelephone(bool);
bool formatDetectionTelephone() const { return m_format_detection_telephone; }
#endif
#ifdef ANDROID_MULTIPLE_WINDOWS
diff --git a/WebCore/platform/android/SystemTimeAndroid.cpp b/WebCore/platform/android/SystemTimeAndroid.cpp
index a9c862a..b4a0699 100644
--- a/WebCore/platform/android/SystemTimeAndroid.cpp
+++ b/WebCore/platform/android/SystemTimeAndroid.cpp
@@ -30,8 +30,9 @@ namespace WebCore {
float userIdleTime()
{
- // Needed for PageCache, which we currently have disabled.
- return 0.0F;
+ // return an arbitrarily high userIdleTime so that releasing pages from the
+ // page cache isn't postponed.
+ return 1000.0F;
}
} // namespace WebCore