Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1415)

Unified Diff: Source/core/page/Settings.cpp

Issue 49913005: Add Settings::deviceScaleAdjustment. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/page/Settings.cpp
diff --git a/Source/core/page/Settings.cpp b/Source/core/page/Settings.cpp
index 3bde44c93c2bbe2bbf28ffc5af339883aee439f3..97704d2d230aa34a288d94b53c1e7b0267eba6fb 100644
--- a/Source/core/page/Settings.cpp
+++ b/Source/core/page/Settings.cpp
@@ -120,6 +120,7 @@ Settings::Settings(Page* page)
#else
, m_textAutosizingEnabled(false)
#endif
+ , m_deviceScaleAdjustment(1.0f)
, m_useWideViewport(true)
, m_loadWithOverviewMode(true)
SETTINGS_INITIALIZER_LIST
@@ -258,10 +259,8 @@ void Settings::setLoadWithOverviewMode(bool loadWithOverviewMode)
m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame()->document()->viewportDescription());
}
-void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
+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.
{
- m_textAutosizingFontScaleFactor = fontScaleFactor;
-
// FIXME: I wonder if this needs to traverse frames like in WebViewImpl::resize, or whether there is only one document per Settings instance?
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext())
frame->document()->textAutosizer()->recalculateMultipliers();
@@ -269,6 +268,18 @@ void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
m_page->setNeedsRecalcStyleInAllFrames();
}
+void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
+{
+ m_textAutosizingFontScaleFactor = fontScaleFactor;
+ recalculateAutosizingMultipliers();
+}
+
+void Settings::setDeviceScaleAdjustment(float deviceScaleAdjustment)
+{
+ m_deviceScaleAdjustment = deviceScaleAdjustment;
+ recalculateAutosizingMultipliers();
+}
+
void Settings::setMediaTypeOverride(const String& mediaTypeOverride)
{
if (m_mediaTypeOverride == mediaTypeOverride)

Powered by Google App Engine
This is Rietveld 408576698