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

Unified Diff: Source/core/rendering/FastTextAutosizer.cpp

Issue 146683003: Settings should not call into inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 11 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/Page.cpp ('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/rendering/FastTextAutosizer.cpp
diff --git a/Source/core/rendering/FastTextAutosizer.cpp b/Source/core/rendering/FastTextAutosizer.cpp
index 70c8732bbba6fb59282b1c336e9da270fa29b7ea..37979f9c8caf8e032a321b57c295068e20c88160 100644
--- a/Source/core/rendering/FastTextAutosizer.cpp
+++ b/Source/core/rendering/FastTextAutosizer.cpp
@@ -35,6 +35,7 @@
#include "core/frame/Frame.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "core/page/Page.h"
#include "core/rendering/InlineIterator.h"
#include "core/rendering/RenderBlock.h"
@@ -152,10 +153,10 @@ void FastTextAutosizer::inflate(RenderBlock* block)
bool FastTextAutosizer::enabled()
{
- return m_document->settings()
- && m_document->settings()->textAutosizingEnabled()
- && !m_document->printing()
- && m_document->page();
+ if (!m_document->settings() || !m_document->page() || m_document->printing())
+ return false;
+
+ return InspectorInstrumentation::overrideTextAutosizing(m_document->page(), m_document->settings()->textAutosizingEnabled());
}
void FastTextAutosizer::prepareRenderViewInfo(RenderView* renderView)
@@ -175,8 +176,10 @@ void FastTextAutosizer::prepareRenderViewInfo(RenderView* renderView)
m_baseMultiplier = m_document->settings()->accessibilityFontScaleFactor();
// If the page has a meta viewport or @viewport, don't apply the device scale adjustment.
const ViewportDescription& viewportDescription = m_document->page()->mainFrame()->document()->viewportDescription();
- if (!viewportDescription.isSpecifiedByAuthor())
- m_baseMultiplier *= m_document->settings()->deviceScaleAdjustment();
+ if (!viewportDescription.isSpecifiedByAuthor()) {
+ float deviceScaleAdjustment = InspectorInstrumentation::overrideFontScaleFactor(m_document->page(), m_document->settings()->deviceScaleAdjustment());
+ m_baseMultiplier *= deviceScaleAdjustment;
+ }
#ifndef NDEBUG
m_renderViewInfoPrepared = true;
#endif
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/rendering/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698