OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "net/base/filename_util.h" | 21 #include "net/base/filename_util.h" |
22 #include "net/url_request/url_request_context.h" | 22 #include "net/url_request/url_request_context.h" |
23 #include "third_party/WebKit/public/platform/WebCString.h" | 23 #include "third_party/WebKit/public/platform/WebCString.h" |
24 #include "third_party/WebKit/public/platform/WebData.h" | 24 #include "third_party/WebKit/public/platform/WebData.h" |
25 #include "third_party/WebKit/public/platform/WebString.h" | 25 #include "third_party/WebKit/public/platform/WebString.h" |
26 #include "third_party/WebKit/public/platform/WebURL.h" | 26 #include "third_party/WebKit/public/platform/WebURL.h" |
27 #include "third_party/WebKit/public/platform/WebVector.h" | 27 #include "third_party/WebKit/public/platform/WebVector.h" |
28 #include "third_party/WebKit/public/web/WebDocument.h" | 28 #include "third_party/WebKit/public/web/WebDocument.h" |
29 #include "third_party/WebKit/public/web/WebElement.h" | 29 #include "third_party/WebKit/public/web/WebElement.h" |
30 #include "third_party/WebKit/public/web/WebElementCollection.h" | 30 #include "third_party/WebKit/public/web/WebElementCollection.h" |
31 #include "third_party/WebKit/public/web/WebFrame.h" | 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
32 #include "third_party/WebKit/public/web/WebNode.h" | 32 #include "third_party/WebKit/public/web/WebNode.h" |
33 #include "third_party/WebKit/public/web/WebNodeList.h" | 33 #include "third_party/WebKit/public/web/WebNodeList.h" |
34 #include "third_party/WebKit/public/web/WebPageSerializer.h" | 34 #include "third_party/WebKit/public/web/WebPageSerializer.h" |
35 #include "third_party/WebKit/public/web/WebPageSerializerClient.h" | 35 #include "third_party/WebKit/public/web/WebPageSerializerClient.h" |
36 #include "third_party/WebKit/public/web/WebView.h" | 36 #include "third_party/WebKit/public/web/WebView.h" |
37 | 37 |
38 using blink::WebCString; | 38 using blink::WebCString; |
39 using blink::WebData; | 39 using blink::WebData; |
40 using blink::WebDocument; | 40 using blink::WebDocument; |
41 using blink::WebElement; | 41 using blink::WebElement; |
42 using blink::WebElementCollection; | 42 using blink::WebElementCollection; |
43 using blink::WebFrame; | 43 using blink::WebFrame; |
| 44 using blink::WebLocalFrame; |
44 using blink::WebNode; | 45 using blink::WebNode; |
45 using blink::WebNodeList; | 46 using blink::WebNodeList; |
46 using blink::WebPageSerializer; | 47 using blink::WebPageSerializer; |
47 using blink::WebPageSerializerClient; | 48 using blink::WebPageSerializerClient; |
48 using blink::WebString; | 49 using blink::WebString; |
49 using blink::WebURL; | 50 using blink::WebURL; |
50 using blink::WebView; | 51 using blink::WebView; |
51 using blink::WebVector; | 52 using blink::WebVector; |
52 | 53 |
53 namespace { | 54 namespace { |
(...skipping 17 matching lines...) Expand all Loading... |
71 WebFrame* current_frame = stack.back(); | 72 WebFrame* current_frame = stack.back(); |
72 stack.pop_back(); | 73 stack.pop_back(); |
73 if (GURL(current_frame->document().url()) == url) | 74 if (GURL(current_frame->document().url()) == url) |
74 return current_frame; | 75 return current_frame; |
75 WebElementCollection all = current_frame->document().all(); | 76 WebElementCollection all = current_frame->document().all(); |
76 for (WebElement element = all.firstItem(); | 77 for (WebElement element = all.firstItem(); |
77 !element.isNull(); element = all.nextItem()) { | 78 !element.isNull(); element = all.nextItem()) { |
78 // Check frame tag and iframe tag | 79 // Check frame tag and iframe tag |
79 if (!element.hasTagName("frame") && !element.hasTagName("iframe")) | 80 if (!element.hasTagName("frame") && !element.hasTagName("iframe")) |
80 continue; | 81 continue; |
81 WebFrame* sub_frame = WebFrame::fromFrameOwnerElement(element); | 82 WebFrame* sub_frame = WebLocalFrame::fromFrameOwnerElement(element); |
82 if (sub_frame) | 83 if (sub_frame) |
83 stack.push_back(sub_frame); | 84 stack.push_back(sub_frame); |
84 } | 85 } |
85 } | 86 } |
86 return NULL; | 87 return NULL; |
87 } | 88 } |
88 | 89 |
89 // Helper function that test whether the first node in the doc is a doc type | 90 // Helper function that test whether the first node in the doc is a doc type |
90 // node. | 91 // node. |
91 bool HasDocType(const WebDocument& doc) { | 92 bool HasDocType(const WebDocument& doc) { |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 NavigateToURL(shell(), file_url); | 1017 NavigateToURL(shell(), file_url); |
1017 | 1018 |
1018 PostTaskToInProcessRendererAndWait( | 1019 PostTaskToInProcessRendererAndWait( |
1019 base::Bind( | 1020 base::Bind( |
1020 &DomSerializerTests:: | 1021 &DomSerializerTests:: |
1021 SubResourceForElementsInNonHTMLNamespaceOnRenderer, | 1022 SubResourceForElementsInNonHTMLNamespaceOnRenderer, |
1022 base::Unretained(this), file_url)); | 1023 base::Unretained(this), file_url)); |
1023 } | 1024 } |
1024 | 1025 |
1025 } // namespace content | 1026 } // namespace content |
OLD | NEW |