OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "public/web/WebFrame.h" | 33 #include "public/web/WebFrame.h" |
34 | 34 |
35 #include "SkBitmap.h" | 35 #include "SkBitmap.h" |
36 #include "SkCanvas.h" | 36 #include "SkCanvas.h" |
37 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 37 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
38 #include "bindings/core/v8/V8Node.h" | 38 #include "bindings/core/v8/V8Node.h" |
| 39 #include "core/UserAgentStyleSheets.h" |
39 #include "core/clipboard/DataTransfer.h" | 40 #include "core/clipboard/DataTransfer.h" |
40 #include "core/css/StyleSheetContents.h" | 41 #include "core/css/StyleSheetContents.h" |
41 #include "core/css/resolver/StyleResolver.h" | 42 #include "core/css/resolver/StyleResolver.h" |
42 #include "core/css/resolver/ViewportStyleResolver.h" | 43 #include "core/css/resolver/ViewportStyleResolver.h" |
43 #include "core/dom/DocumentMarkerController.h" | 44 #include "core/dom/DocumentMarkerController.h" |
44 #include "core/dom/Fullscreen.h" | 45 #include "core/dom/Fullscreen.h" |
45 #include "core/dom/NodeRenderStyle.h" | 46 #include "core/dom/NodeRenderStyle.h" |
46 #include "core/dom/Range.h" | 47 #include "core/dom/Range.h" |
47 #include "core/editing/Editor.h" | 48 #include "core/editing/Editor.h" |
48 #include "core/editing/FrameSelection.h" | 49 #include "core/editing/FrameSelection.h" |
(...skipping 19 matching lines...) Expand all Loading... |
68 #include "core/page/Page.h" | 69 #include "core/page/Page.h" |
69 #include "core/rendering/HitTestResult.h" | 70 #include "core/rendering/HitTestResult.h" |
70 #include "core/rendering/RenderFullScreen.h" | 71 #include "core/rendering/RenderFullScreen.h" |
71 #include "core/rendering/RenderView.h" | 72 #include "core/rendering/RenderView.h" |
72 #include "core/rendering/compositing/RenderLayerCompositor.h" | 73 #include "core/rendering/compositing/RenderLayerCompositor.h" |
73 #include "core/testing/NullExecutionContext.h" | 74 #include "core/testing/NullExecutionContext.h" |
74 #include "core/testing/URLTestHelpers.h" | 75 #include "core/testing/URLTestHelpers.h" |
75 #include "modules/mediastream/MediaStream.h" | 76 #include "modules/mediastream/MediaStream.h" |
76 #include "modules/mediastream/MediaStreamRegistry.h" | 77 #include "modules/mediastream/MediaStreamRegistry.h" |
77 #include "platform/DragImage.h" | 78 #include "platform/DragImage.h" |
78 #include "platform/PlatformResourceLoader.h" | |
79 #include "platform/RuntimeEnabledFeatures.h" | 79 #include "platform/RuntimeEnabledFeatures.h" |
80 #include "platform/UserGestureIndicator.h" | 80 #include "platform/UserGestureIndicator.h" |
81 #include "platform/geometry/FloatRect.h" | 81 #include "platform/geometry/FloatRect.h" |
82 #include "platform/network/ResourceError.h" | 82 #include "platform/network/ResourceError.h" |
83 #include "platform/scroll/ScrollbarTheme.h" | 83 #include "platform/scroll/ScrollbarTheme.h" |
84 #include "platform/weborigin/SchemeRegistry.h" | 84 #include "platform/weborigin/SchemeRegistry.h" |
85 #include "public/platform/Platform.h" | 85 #include "public/platform/Platform.h" |
86 #include "public/platform/WebFloatRect.h" | 86 #include "public/platform/WebFloatRect.h" |
87 #include "public/platform/WebSelectionBound.h" | 87 #include "public/platform/WebSelectionBound.h" |
88 #include "public/platform/WebThread.h" | 88 #include "public/platform/WebThread.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 response.initialize(); | 180 response.initialize(); |
181 response.setMIMEType("text/html"); | 181 response.setMIMEType("text/html"); |
182 response.addHTTPHeaderField(reportOnly ? WebString("Content-Security-Pol
icy-Report-Only") : WebString("Content-Security-Policy"), WebString::fromUTF8(cs
p)); | 182 response.addHTTPHeaderField(reportOnly ? WebString("Content-Security-Pol
icy-Report-Only") : WebString("Content-Security-Policy"), WebString::fromUTF8(cs
p)); |
183 std::string fullString = m_baseURL + fileName; | 183 std::string fullString = m_baseURL + fileName; |
184 URLTestHelpers::registerMockedURLLoadWithCustomResponse(toKURL(fullStrin
g.c_str()), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8(""), resp
onse); | 184 URLTestHelpers::registerMockedURLLoadWithCustomResponse(toKURL(fullStrin
g.c_str()), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8(""), resp
onse); |
185 } | 185 } |
186 | 186 |
187 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) | 187 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) |
188 { | 188 { |
189 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::
create(CSSParserContext(UASheetMode, 0)); | 189 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::
create(CSSParserContext(UASheetMode, 0)); |
190 styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css")
); | 190 styleSheet->parseString(String(blink::viewportAndroidCss, sizeof(blink::
viewportAndroidCss))); |
191 OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); | 191 OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); |
192 ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen
")); | 192 ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen
")); |
193 | 193 |
194 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); | 194 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); |
195 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); | 195 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); |
196 document->ensureStyleResolver().viewportStyleResolver()->resolve(); | 196 document->ensureStyleResolver().viewportStyleResolver()->resolve(); |
197 } | 197 } |
198 | 198 |
199 static void configueCompositingWebView(WebSettings* settings) | 199 static void configueCompositingWebView(WebSettings* settings) |
200 { | 200 { |
(...skipping 6722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6923 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6923 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6924 | 6924 |
6925 // Neither should a page reload. | 6925 // Neither should a page reload. |
6926 localFrame->reload(); | 6926 localFrame->reload(); |
6927 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6927 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6928 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6928 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6929 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6929 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6930 } | 6930 } |
6931 | 6931 |
6932 } // namespace | 6932 } // namespace |
OLD | NEW |