Chromium Code Reviews| Index: Source/core/inspector/InspectorPageAgent.cpp |
| diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp |
| index 1b7f440cd759e3c4b1bf42b5028e64259e44f796..71b699f7fcb07f7e41f17958eaf8e153f274d6ce 100644 |
| --- a/Source/core/inspector/InspectorPageAgent.cpp |
| +++ b/Source/core/inspector/InspectorPageAgent.cpp |
| @@ -38,7 +38,6 @@ |
| #include "core/animation/AnimationTimeline.h" |
| #include "core/css/StyleSheetContents.h" |
| #include "core/css/resolver/StyleResolver.h" |
| -#include "core/css/resolver/ViewportStyleResolver.h" |
| #include "core/dom/DOMImplementation.h" |
| #include "core/dom/Document.h" |
| #include "core/fetch/CSSStyleSheetResource.h" |
| @@ -1451,17 +1450,9 @@ void InspectorPageAgent::setEmulatedMedia(ErrorString*, const String& media) |
| } |
| } |
| -bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver) |
| +bool InspectorPageAgent::shouldApplyViewportStyleOverride() |
| { |
| - if (!m_deviceMetricsOverridden || !m_emulateMobileEnabled) |
| - return false; |
| - |
| - RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(CSSParserContext(UASheetMode, 0)); |
| - styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css")); |
| - OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); |
| - ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen")); |
| - resolver->viewportStyleResolver()->collectViewportRules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); |
| - return true; |
| + return m_deviceMetricsOverridden && m_emulateMobileEnabled; |
|
dgozman
2015/03/05 10:55:53
Since you are moving the heavy work into resolver
rune
2015/03/05 12:11:50
You mean setting as in add to Settings.in?
If so,
aelias_OOO_until_Jul13
2015/03/05 21:07:27
Yes, I was already thinking myself that that #if O
|
| } |
| void InspectorPageAgent::applyEmulatedMedia(String* media) |