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 "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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 | 73 |
74 // Global variable used by the plugin quirk "die after unload". | 74 // Global variable used by the plugin quirk "die after unload". |
75 bool g_forcefully_terminate_plugin_process = false; | 75 bool g_forcefully_terminate_plugin_process = false; |
76 | 76 |
77 void SetJavaScriptFlags(const std::string& str) { | 77 void SetJavaScriptFlags(const std::string& str) { |
78 #if WEBKIT_USING_V8 | 78 #if WEBKIT_USING_V8 |
79 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); | 79 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); |
80 #endif | 80 #endif |
81 } | 81 } |
82 | 82 |
83 void EnableWebCoreNotImplementedLogging() { | 83 void EnableWebCoreLogChannels(const std::string& channels) { |
84 WebKit::enableLogChannel("NotYetImplemented"); | 84 if (channels.empty()) |
85 return; | |
86 size_t elem_begin = 0; | |
87 size_t elem_end = channels.find(','); | |
darin (slow to review)
2011/02/15 20:54:56
i think you should be using StringSplit or StringT
gavinp
2011/02/15 21:25:48
Done.
| |
88 while (true) { | |
89 const std::string elem(channels, elem_begin, elem_end); | |
90 WebKit::enableLogChannel(elem.c_str()); | |
91 if (elem_end == std::string::npos) | |
92 break; | |
93 elem_begin = elem_end + 1; | |
94 elem_end = channels.find(',', elem_begin); | |
95 } | |
85 } | 96 } |
86 | 97 |
87 string16 DumpDocumentText(WebFrame* web_frame) { | 98 string16 DumpDocumentText(WebFrame* web_frame) { |
88 // We use the document element's text instead of the body text here because | 99 // We use the document element's text instead of the body text here because |
89 // not all documents have a body, such as XML documents. | 100 // not all documents have a body, such as XML documents. |
90 WebElement document_element = web_frame->document().documentElement(); | 101 WebElement document_element = web_frame->document().documentElement(); |
91 if (document_element.isNull()) | 102 if (document_element.isNull()) |
92 return string16(); | 103 return string16(); |
93 | 104 |
94 return document_element.innerText(); | 105 return document_element.innerText(); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
405 NOTIMPLEMENTED(); | 416 NOTIMPLEMENTED(); |
406 return NULL; | 417 return NULL; |
407 #endif | 418 #endif |
408 } | 419 } |
409 | 420 |
410 int GetGlyphPageCount() { | 421 int GetGlyphPageCount() { |
411 return WebGlyphCache::pageCount(); | 422 return WebGlyphCache::pageCount(); |
412 } | 423 } |
413 | 424 |
414 } // namespace webkit_glue | 425 } // namespace webkit_glue |
OLD | NEW |