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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
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 | 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 "core/UserAgentStyleSheets.h" | |
38 #include "core/clipboard/DataTransfer.h" | 37 #include "core/clipboard/DataTransfer.h" |
39 #include "core/css/StyleSheetContents.h" | 38 #include "core/css/StyleSheetContents.h" |
40 #include "core/css/resolver/StyleResolver.h" | 39 #include "core/css/resolver/StyleResolver.h" |
41 #include "core/css/resolver/ViewportStyleResolver.h" | 40 #include "core/css/resolver/ViewportStyleResolver.h" |
42 #include "core/dom/DocumentMarkerController.h" | 41 #include "core/dom/DocumentMarkerController.h" |
43 #include "core/dom/Fullscreen.h" | 42 #include "core/dom/Fullscreen.h" |
44 #include "core/dom/NodeRenderStyle.h" | 43 #include "core/dom/NodeRenderStyle.h" |
45 #include "core/dom/Range.h" | 44 #include "core/dom/Range.h" |
46 #include "core/editing/Editor.h" | 45 #include "core/editing/Editor.h" |
47 #include "core/editing/FrameSelection.h" | 46 #include "core/editing/FrameSelection.h" |
(...skipping 10 matching lines...) Expand all Loading... |
58 #include "core/loader/DocumentThreadableLoaderClient.h" | 57 #include "core/loader/DocumentThreadableLoaderClient.h" |
59 #include "core/loader/FrameLoadRequest.h" | 58 #include "core/loader/FrameLoadRequest.h" |
60 #include "core/loader/ThreadableLoader.h" | 59 #include "core/loader/ThreadableLoader.h" |
61 #include "core/page/EventHandler.h" | 60 #include "core/page/EventHandler.h" |
62 #include "core/page/Page.h" | 61 #include "core/page/Page.h" |
63 #include "core/rendering/HitTestResult.h" | 62 #include "core/rendering/HitTestResult.h" |
64 #include "core/rendering/RenderView.h" | 63 #include "core/rendering/RenderView.h" |
65 #include "core/rendering/compositing/RenderLayerCompositor.h" | 64 #include "core/rendering/compositing/RenderLayerCompositor.h" |
66 #include "core/testing/URLTestHelpers.h" | 65 #include "core/testing/URLTestHelpers.h" |
67 #include "platform/DragImage.h" | 66 #include "platform/DragImage.h" |
| 67 #include "platform/PlatformResourceLoader.h" |
68 #include "platform/RuntimeEnabledFeatures.h" | 68 #include "platform/RuntimeEnabledFeatures.h" |
69 #include "platform/UserGestureIndicator.h" | 69 #include "platform/UserGestureIndicator.h" |
70 #include "platform/geometry/FloatRect.h" | 70 #include "platform/geometry/FloatRect.h" |
71 #include "platform/network/ResourceError.h" | 71 #include "platform/network/ResourceError.h" |
72 #include "platform/scroll/ScrollbarTheme.h" | 72 #include "platform/scroll/ScrollbarTheme.h" |
73 #include "platform/weborigin/SchemeRegistry.h" | 73 #include "platform/weborigin/SchemeRegistry.h" |
74 #include "public/platform/Platform.h" | 74 #include "public/platform/Platform.h" |
75 #include "public/platform/WebFloatRect.h" | 75 #include "public/platform/WebFloatRect.h" |
76 #include "public/platform/WebSelectionBound.h" | 76 #include "public/platform/WebSelectionBound.h" |
77 #include "public/platform/WebThread.h" | 77 #include "public/platform/WebThread.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 void registerMockedChromeURLLoad(const std::string& fileName) | 147 void registerMockedChromeURLLoad(const std::string& fileName) |
148 { | 148 { |
149 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom
eURL.c_str()), WebString::fromUTF8(fileName.c_str())); | 149 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom
eURL.c_str()), WebString::fromUTF8(fileName.c_str())); |
150 } | 150 } |
151 | 151 |
152 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) | 152 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp
er) |
153 { | 153 { |
154 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::
create(CSSParserContext(UASheetMode, 0)); | 154 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::
create(CSSParserContext(UASheetMode, 0)); |
155 styleSheet->parseString(String(blink::viewportAndroidCss, sizeof(blink::
viewportAndroidCss))); | 155 styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css")
); |
156 OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); | 156 OwnPtrWillBeRawPtr<RuleSet> ruleSet = RuleSet::create(); |
157 ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen
")); | 157 ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen
")); |
158 | 158 |
159 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); | 159 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->
mainFrame())->document(); |
160 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); | 160 document->ensureStyleResolver().viewportStyleResolver()->collectViewport
Rules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); |
161 document->ensureStyleResolver().viewportStyleResolver()->resolve(); | 161 document->ensureStyleResolver().viewportStyleResolver()->resolve(); |
162 } | 162 } |
163 | 163 |
164 static void configueCompositingWebView(WebSettings* settings) | 164 static void configueCompositingWebView(WebSettings* settings) |
165 { | 165 { |
(...skipping 6106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6272 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6272 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6273 | 6273 |
6274 // Neither should a page reload. | 6274 // Neither should a page reload. |
6275 localFrame->reload(); | 6275 localFrame->reload(); |
6276 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6276 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6277 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6277 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6278 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6278 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6279 } | 6279 } |
6280 | 6280 |
6281 } // namespace | 6281 } // namespace |
OLD | NEW |