| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 #include "webkit/glue/webkit_glue.h" | 6 #include "webkit/glue/webkit_glue.h" |
| 7 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <mlang.h> | 10 #include <mlang.h> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "webkit/api/public/win/WebInputEventFactory.h" | 42 #include "webkit/api/public/win/WebInputEventFactory.h" |
| 43 #endif | 43 #endif |
| 44 #include "webkit/glue/event_conversion.h" | 44 #include "webkit/glue/event_conversion.h" |
| 45 #include "webkit/glue/glue_serialize.h" | 45 #include "webkit/glue/glue_serialize.h" |
| 46 #include "webkit/glue/glue_util.h" | 46 #include "webkit/glue/glue_util.h" |
| 47 #include "webkit/glue/webframe_impl.h" | 47 #include "webkit/glue/webframe_impl.h" |
| 48 #include "webkit/glue/webview_impl.h" | 48 #include "webkit/glue/webview_impl.h" |
| 49 | 49 |
| 50 #include "webkit_version.h" // Generated | 50 #include "webkit_version.h" // Generated |
| 51 | 51 |
| 52 using WebKit::WebFrame; |
| 52 using WebKit::WebHistoryItem; | 53 using WebKit::WebHistoryItem; |
| 53 using WebKit::WebString; | 54 using WebKit::WebString; |
| 54 using WebKit::WebVector; | 55 using WebKit::WebVector; |
| 55 | 56 |
| 56 //------------------------------------------------------------------------------ | 57 //------------------------------------------------------------------------------ |
| 57 // webkit_glue impl: | 58 // webkit_glue impl: |
| 58 | 59 |
| 59 namespace webkit_glue { | 60 namespace webkit_glue { |
| 60 | 61 |
| 61 // Global variable used by the plugin quirk "die after unload". | 62 // Global variable used by the plugin quirk "die after unload". |
| (...skipping 21 matching lines...) Expand all Loading... |
| 83 return std::wstring(); | 84 return std::wstring(); |
| 84 } | 85 } |
| 85 return StringToStdWString(documentElement->innerText()); | 86 return StringToStdWString(documentElement->innerText()); |
| 86 } | 87 } |
| 87 | 88 |
| 88 std::wstring DumpFramesAsText(WebFrame* web_frame, bool recursive) { | 89 std::wstring DumpFramesAsText(WebFrame* web_frame, bool recursive) { |
| 89 WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(web_frame); | 90 WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(web_frame); |
| 90 std::wstring result; | 91 std::wstring result; |
| 91 | 92 |
| 92 // Add header for all but the main frame. Skip empty frames. | 93 // Add header for all but the main frame. Skip empty frames. |
| 93 if (webFrameImpl->GetParent() && | 94 if (webFrameImpl->parent() && |
| 94 webFrameImpl->frame()->document()->documentElement()) { | 95 webFrameImpl->frame()->document()->documentElement()) { |
| 95 result.append(L"\n--------\nFrame: '"); | 96 result.append(L"\n--------\nFrame: '"); |
| 96 result.append(webFrameImpl->GetName()); | 97 result.append(UTF16ToWideHack(webFrameImpl->name())); |
| 97 result.append(L"'\n--------\n"); | 98 result.append(L"'\n--------\n"); |
| 98 } | 99 } |
| 99 | 100 |
| 100 result.append(DumpDocumentText(web_frame)); | 101 result.append(DumpDocumentText(web_frame)); |
| 101 result.append(L"\n"); | 102 result.append(L"\n"); |
| 102 | 103 |
| 103 if (recursive) { | 104 if (recursive) { |
| 104 WebCore::Frame* child = webFrameImpl->frame()->tree()->firstChild(); | 105 WebCore::Frame* child = webFrameImpl->frame()->tree()->firstChild(); |
| 105 for (; child; child = child->tree()->nextSibling()) { | 106 for (; child; child = child->tree()->nextSibling()) { |
| 106 result.append( | 107 result.append( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 119 WebCore::externalRepresentation(frame->contentRenderer()); | 120 WebCore::externalRepresentation(frame->contentRenderer()); |
| 120 return StringToStdWString(frameText); | 121 return StringToStdWString(frameText); |
| 121 } | 122 } |
| 122 | 123 |
| 123 std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { | 124 std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { |
| 124 WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(web_frame); | 125 WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(web_frame); |
| 125 WebCore::IntSize offset = webFrameImpl->frameview()->scrollOffset(); | 126 WebCore::IntSize offset = webFrameImpl->frameview()->scrollOffset(); |
| 126 std::wstring result; | 127 std::wstring result; |
| 127 | 128 |
| 128 if (offset.width() > 0 || offset.height() > 0) { | 129 if (offset.width() > 0 || offset.height() > 0) { |
| 129 if (webFrameImpl->GetParent()) { | 130 if (webFrameImpl->parent()) { |
| 130 StringAppendF(&result, L"frame '%ls' ", StringToStdWString( | 131 StringAppendF(&result, L"frame '%ls' ", StringToStdWString( |
| 131 webFrameImpl->frame()->tree()->name()).c_str()); | 132 webFrameImpl->frame()->tree()->name()).c_str()); |
| 132 } | 133 } |
| 133 StringAppendF(&result, L"scrolled to %d,%d\n", | 134 StringAppendF(&result, L"scrolled to %d,%d\n", |
| 134 offset.width(), offset.height()); | 135 offset.width(), offset.height()); |
| 135 } | 136 } |
| 136 | 137 |
| 137 if (recursive) { | 138 if (recursive) { |
| 138 WebCore::Frame* child = webFrameImpl->frame()->tree()->firstChild(); | 139 WebCore::Frame* child = webFrameImpl->frame()->tree()->firstChild(); |
| 139 for (; child; child = child->tree()->nextSibling()) { | 140 for (; child; child = child->tree()->nextSibling()) { |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 432 } |
| 432 | 433 |
| 433 g_forcefully_terminate_plugin_process = value; | 434 g_forcefully_terminate_plugin_process = value; |
| 434 } | 435 } |
| 435 | 436 |
| 436 bool ShouldForcefullyTerminatePluginProcess() { | 437 bool ShouldForcefullyTerminatePluginProcess() { |
| 437 return g_forcefully_terminate_plugin_process; | 438 return g_forcefully_terminate_plugin_process; |
| 438 } | 439 } |
| 439 | 440 |
| 440 } // namespace webkit_glue | 441 } // namespace webkit_glue |
| OLD | NEW |