OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <objidl.h> | 8 #include <objidl.h> |
9 #include <mlang.h> | 9 #include <mlang.h> |
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return document_element.innerText(); | 112 return document_element.innerText(); |
113 } | 113 } |
114 | 114 |
115 string16 DumpFramesAsText(WebFrame* web_frame, bool recursive) { | 115 string16 DumpFramesAsText(WebFrame* web_frame, bool recursive) { |
116 string16 result; | 116 string16 result; |
117 | 117 |
118 // Add header for all but the main frame. Skip empty frames. | 118 // Add header for all but the main frame. Skip empty frames. |
119 if (web_frame->parent() && | 119 if (web_frame->parent() && |
120 !web_frame->document().documentElement().isNull()) { | 120 !web_frame->document().documentElement().isNull()) { |
121 result.append(ASCIIToUTF16("\n--------\nFrame: '")); | 121 result.append(ASCIIToUTF16("\n--------\nFrame: '")); |
122 result.append(web_frame->name()); | 122 result.append(web_frame->uniqueName()); |
123 result.append(ASCIIToUTF16("'\n--------\n")); | 123 result.append(ASCIIToUTF16("'\n--------\n")); |
124 } | 124 } |
125 | 125 |
126 result.append(DumpDocumentText(web_frame)); | 126 result.append(DumpDocumentText(web_frame)); |
127 result.append(ASCIIToUTF16("\n")); | 127 result.append(ASCIIToUTF16("\n")); |
128 | 128 |
129 if (recursive) { | 129 if (recursive) { |
130 WebFrame* child = web_frame->firstChild(); | 130 WebFrame* child = web_frame->firstChild(); |
131 for (; child; child = child->nextSibling()) | 131 for (; child; child = child->nextSibling()) |
132 result.append(DumpFramesAsText(child, recursive)); | 132 result.append(DumpFramesAsText(child, recursive)); |
(...skipping 22 matching lines...) Expand all Loading... |
155 return number_of_pages; | 155 return number_of_pages; |
156 } | 156 } |
157 | 157 |
158 string16 DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { | 158 string16 DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { |
159 gfx::Size offset = web_frame->scrollOffset(); | 159 gfx::Size offset = web_frame->scrollOffset(); |
160 std::string result_utf8; | 160 std::string result_utf8; |
161 | 161 |
162 if (offset.width() > 0 || offset.height() > 0) { | 162 if (offset.width() > 0 || offset.height() > 0) { |
163 if (web_frame->parent()) { | 163 if (web_frame->parent()) { |
164 base::StringAppendF(&result_utf8, "frame '%s' ", | 164 base::StringAppendF(&result_utf8, "frame '%s' ", |
165 UTF16ToUTF8(web_frame->name()).c_str()); | 165 UTF16ToUTF8(web_frame->uniqueName()).c_str()); |
166 } | 166 } |
167 base::StringAppendF(&result_utf8, "scrolled to %d,%d\n", | 167 base::StringAppendF(&result_utf8, "scrolled to %d,%d\n", |
168 offset.width(), offset.height()); | 168 offset.width(), offset.height()); |
169 } | 169 } |
170 | 170 |
171 string16 result = UTF8ToUTF16(result_utf8); | 171 string16 result = UTF8ToUTF16(result_utf8); |
172 | 172 |
173 if (recursive) { | 173 if (recursive) { |
174 WebFrame* child = web_frame->firstChild(); | 174 WebFrame* child = web_frame->firstChild(); |
175 for (; child; child = child->nextSibling()) | 175 for (; child; child = child->nextSibling()) |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 case WebKit::WebReferrerPolicyOrigin: | 490 case WebKit::WebReferrerPolicyOrigin: |
491 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; | 491 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; |
492 break; | 492 break; |
493 } | 493 } |
494 request->set_referrer_policy(net_referrer_policy); | 494 request->set_referrer_policy(net_referrer_policy); |
495 } | 495 } |
496 | 496 |
497 COMPILE_ASSERT(std::numeric_limits<double>::has_quiet_NaN, has_quiet_NaN); | 497 COMPILE_ASSERT(std::numeric_limits<double>::has_quiet_NaN, has_quiet_NaN); |
498 | 498 |
499 } // namespace webkit_glue | 499 } // namespace webkit_glue |
OLD | NEW |