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) |
11 #include <sys/utsname.h> | 11 #include <sys/utsname.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
17 #include "base/string_piece.h" | 17 #include "base/string_piece.h" |
| 18 #include "base/string_tokenizer.h" |
18 #include "base/string_util.h" | 19 #include "base/string_util.h" |
19 #include "base/stringprintf.h" | 20 #include "base/stringprintf.h" |
20 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
21 #include "base/sys_string_conversions.h" | 22 #include "base/sys_string_conversions.h" |
22 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
23 #include "net/base/escape.h" | 24 #include "net/base/escape.h" |
24 #include "skia/ext/platform_canvas.h" | 25 #include "skia/ext/platform_canvas.h" |
25 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
26 #include "skia/ext/skia_utils_mac.h" | 27 #include "skia/ext/skia_utils_mac.h" |
27 #endif | 28 #endif |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 74 |
74 // Global variable used by the plugin quirk "die after unload". | 75 // Global variable used by the plugin quirk "die after unload". |
75 bool g_forcefully_terminate_plugin_process = false; | 76 bool g_forcefully_terminate_plugin_process = false; |
76 | 77 |
77 void SetJavaScriptFlags(const std::string& str) { | 78 void SetJavaScriptFlags(const std::string& str) { |
78 #if WEBKIT_USING_V8 | 79 #if WEBKIT_USING_V8 |
79 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); | 80 v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size())); |
80 #endif | 81 #endif |
81 } | 82 } |
82 | 83 |
83 void EnableWebCoreNotImplementedLogging() { | 84 void EnableWebCoreLogChannels(const std::string& channels) { |
84 WebKit::enableLogChannel("NotYetImplemented"); | 85 if (channels.empty()) |
| 86 return; |
| 87 StringTokenizer t(channels, ", "); |
| 88 while (t.GetNext()) { |
| 89 WebKit::enableLogChannel(t.token().c_str()); |
| 90 } |
85 } | 91 } |
86 | 92 |
87 string16 DumpDocumentText(WebFrame* web_frame) { | 93 string16 DumpDocumentText(WebFrame* web_frame) { |
88 // We use the document element's text instead of the body text here because | 94 // 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. | 95 // not all documents have a body, such as XML documents. |
90 WebElement document_element = web_frame->document().documentElement(); | 96 WebElement document_element = web_frame->document().documentElement(); |
91 if (document_element.isNull()) | 97 if (document_element.isNull()) |
92 return string16(); | 98 return string16(); |
93 | 99 |
94 return document_element.innerText(); | 100 return document_element.innerText(); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 NOTIMPLEMENTED(); | 411 NOTIMPLEMENTED(); |
406 return NULL; | 412 return NULL; |
407 #endif | 413 #endif |
408 } | 414 } |
409 | 415 |
410 int GetGlyphPageCount() { | 416 int GetGlyphPageCount() { |
411 return WebGlyphCache::pageCount(); | 417 return WebGlyphCache::pageCount(); |
412 } | 418 } |
413 | 419 |
414 } // namespace webkit_glue | 420 } // namespace webkit_glue |
OLD | NEW |