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

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: Address review comments. 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
« no previous file with comments | « Source/core/page/Settings.h ('k') | Source/core/rendering/TextAutosizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/Settings.cpp
diff --git a/Source/core/page/Settings.cpp b/Source/core/page/Settings.cpp
index 3bde44c93c2bbe2bbf28ffc5af339883aee439f3..abbd79cf15b151184041d6fa29ae53a134cc8f16 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)
pdr. 2013/10/30 04:53:08 I think you'll need to move this above m_textAutos
skobes 2013/10/30 17:35:51 Done.
, 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::recalculateTextAutosizingMultipliers()
{
- 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;
+ recalculateTextAutosizingMultipliers();
+}
+
+void Settings::setDeviceScaleAdjustment(float deviceScaleAdjustment)
pdr. 2013/10/30 04:53:08 In plumbing this through for the inspector side I
skobes 2013/10/30 17:35:51 I tried to make the name agnostic as to where it i
+{
+ m_deviceScaleAdjustment = deviceScaleAdjustment;
+ recalculateTextAutosizingMultipliers();
+}
+
void Settings::setMediaTypeOverride(const String& mediaTypeOverride)
{
if (m_mediaTypeOverride == mediaTypeOverride)
« no previous file with comments | « Source/core/page/Settings.h ('k') | Source/core/rendering/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698