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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 573553002: Move the user agent styles sheets to blink_resources.grd (Part 3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase! Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/inspector/InspectorPageAgent.h" 32 #include "core/inspector/InspectorPageAgent.h"
33 33
34 #include "bindings/core/v8/DOMWrapperWorld.h" 34 #include "bindings/core/v8/DOMWrapperWorld.h"
35 #include "bindings/core/v8/ScriptController.h" 35 #include "bindings/core/v8/ScriptController.h"
36 #include "bindings/core/v8/ScriptRegexp.h" 36 #include "bindings/core/v8/ScriptRegexp.h"
37 #include "core/HTMLNames.h" 37 #include "core/HTMLNames.h"
38 #include "core/UserAgentStyleSheets.h"
39 #include "core/animation/AnimationTimeline.h" 38 #include "core/animation/AnimationTimeline.h"
40 #include "core/css/StyleSheetContents.h" 39 #include "core/css/StyleSheetContents.h"
41 #include "core/css/resolver/StyleResolver.h" 40 #include "core/css/resolver/StyleResolver.h"
42 #include "core/css/resolver/ViewportStyleResolver.h" 41 #include "core/css/resolver/ViewportStyleResolver.h"
43 #include "core/dom/DOMImplementation.h" 42 #include "core/dom/DOMImplementation.h"
44 #include "core/dom/Document.h" 43 #include "core/dom/Document.h"
45 #include "core/fetch/CSSStyleSheetResource.h" 44 #include "core/fetch/CSSStyleSheetResource.h"
46 #include "core/fetch/FontResource.h" 45 #include "core/fetch/FontResource.h"
47 #include "core/fetch/ImageResource.h" 46 #include "core/fetch/ImageResource.h"
48 #include "core/fetch/MemoryCache.h" 47 #include "core/fetch/MemoryCache.h"
(...skipping 20 matching lines...) Expand all
69 #include "core/inspector/InspectorState.h" 68 #include "core/inspector/InspectorState.h"
70 #include "core/inspector/InstrumentingAgents.h" 69 #include "core/inspector/InstrumentingAgents.h"
71 #include "core/loader/CookieJar.h" 70 #include "core/loader/CookieJar.h"
72 #include "core/loader/DocumentLoader.h" 71 #include "core/loader/DocumentLoader.h"
73 #include "core/loader/FrameLoadRequest.h" 72 #include "core/loader/FrameLoadRequest.h"
74 #include "core/loader/FrameLoader.h" 73 #include "core/loader/FrameLoader.h"
75 #include "core/page/Page.h" 74 #include "core/page/Page.h"
76 #include "platform/Cookie.h" 75 #include "platform/Cookie.h"
77 #include "platform/JSONValues.h" 76 #include "platform/JSONValues.h"
78 #include "platform/MIMETypeRegistry.h" 77 #include "platform/MIMETypeRegistry.h"
78 #include "platform/PlatformResourceLoader.h"
79 #include "platform/UserGestureIndicator.h" 79 #include "platform/UserGestureIndicator.h"
80 #include "platform/weborigin/SecurityOrigin.h" 80 #include "platform/weborigin/SecurityOrigin.h"
81 #include "wtf/CurrentTime.h" 81 #include "wtf/CurrentTime.h"
82 #include "wtf/ListHashSet.h" 82 #include "wtf/ListHashSet.h"
83 #include "wtf/Vector.h" 83 #include "wtf/Vector.h"
84 #include "wtf/text/Base64.h" 84 #include "wtf/text/Base64.h"
85 #include "wtf/text/TextEncoding.h" 85 #include "wtf/text/TextEncoding.h"
86 86
87 namespace blink { 87 namespace blink {
88 88
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 document->updateLayout(); 1421 document->updateLayout();
1422 } 1422 }
1423 } 1423 }
1424 1424
1425 bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver) 1425 bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver)
1426 { 1426 {
1427 if (!m_deviceMetricsOverridden || !m_emulateMobileEnabled) 1427 if (!m_deviceMetricsOverridden || !m_emulateMobileEnabled)
1428 return false; 1428 return false;
1429 1429
1430 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::crea te(CSSParserContext(UASheetMode, 0)); 1430 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::crea te(CSSParserContext(UASheetMode, 0));
1431 styleSheet->parseString(String(viewportAndroidCss, sizeof(viewportAndroidCss ))); 1431 styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css"));
1432 OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); 1432 OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create();
1433 ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen")); 1433 ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen"));
1434 resolver->viewportStyleResolver()->collectViewportRules(ruleSet.get(), Viewp ortStyleResolver::UserAgentOrigin); 1434 resolver->viewportStyleResolver()->collectViewportRules(ruleSet.get(), Viewp ortStyleResolver::UserAgentOrigin);
1435 return true; 1435 return true;
1436 } 1436 }
1437 1437
1438 void InspectorPageAgent::applyEmulatedMedia(String* media) 1438 void InspectorPageAgent::applyEmulatedMedia(String* media)
1439 { 1439 {
1440 String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedM edia); 1440 String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedM edia);
1441 if (!emulatedMedia.isEmpty()) 1441 if (!emulatedMedia.isEmpty())
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 void InspectorPageAgent::trace(Visitor* visitor) 1507 void InspectorPageAgent::trace(Visitor* visitor)
1508 { 1508 {
1509 visitor->trace(m_page); 1509 visitor->trace(m_page);
1510 visitor->trace(m_injectedScriptManager); 1510 visitor->trace(m_injectedScriptManager);
1511 visitor->trace(m_inspectorResourceContentLoader); 1511 visitor->trace(m_inspectorResourceContentLoader);
1512 InspectorBaseAgent::trace(visitor); 1512 InspectorBaseAgent::trace(visitor);
1513 } 1513 }
1514 1514
1515 } // namespace blink 1515 } // namespace blink
1516 1516
OLDNEW
« no previous file with comments | « Source/core/css/CSSDefaultStyleSheets.cpp ('k') | Source/core/rendering/RenderThemeChromiumAndroid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698