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/support/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug_util.h" | 9 #include "base/debug_util.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/i18n/icu_util.h" | 12 #include "base/i18n/icu_util.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
| 16 #include "base/string_piece.h" |
16 #include "base/sys_string_conversions.h" | 17 #include "base/sys_string_conversions.h" |
17 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
18 #include "base/weak_ptr.h" | 19 #include "base/weak_ptr.h" |
| 20 #include "grit/webkit_chromium_resources.h" |
19 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
20 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
21 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
22 #include "webkit/appcache/web_application_cache_host_impl.h" | 24 #include "webkit/appcache/web_application_cache_host_impl.h" |
23 #include "webkit/glue/media/buffered_data_source.h" | 25 #include "webkit/glue/media/buffered_data_source.h" |
24 #include "webkit/glue/media/media_resource_loader_bridge_factory.h" | 26 #include "webkit/glue/media/media_resource_loader_bridge_factory.h" |
25 #include "webkit/glue/media/simple_data_source.h" | 27 #include "webkit/glue/media/simple_data_source.h" |
26 #include "webkit/glue/media/video_renderer_impl.h" | 28 #include "webkit/glue/media/video_renderer_impl.h" |
27 #include "webkit/glue/plugins/plugin_list.h" | 29 #include "webkit/glue/plugins/plugin_list.h" |
28 #include "webkit/glue/plugins/webplugin_impl.h" | 30 #include "webkit/glue/plugins/webplugin_impl.h" |
29 #include "webkit/glue/plugins/webplugin_page_delegate.h" | 31 #include "webkit/glue/plugins/webplugin_page_delegate.h" |
30 #include "webkit/glue/plugins/webplugininfo.h" | 32 #include "webkit/glue/plugins/webplugininfo.h" |
| 33 #include "webkit/glue/webkit_glue.h" |
31 #include "webkit/glue/webkitclient_impl.h" | 34 #include "webkit/glue/webkitclient_impl.h" |
32 #include "webkit/glue/webmediaplayer_impl.h" | 35 #include "webkit/glue/webmediaplayer_impl.h" |
33 #include "webkit/support/platform_support.h" | 36 #include "webkit/support/platform_support.h" |
34 #include "webkit/support/test_webplugin_page_delegate.h" | 37 #include "webkit/support/test_webplugin_page_delegate.h" |
35 #include "webkit/support/test_webkit_client.h" | 38 #include "webkit/support/test_webkit_client.h" |
36 #include "webkit/tools/test_shell/simple_database_system.h" | 39 #include "webkit/tools/test_shell/simple_database_system.h" |
37 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 40 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
38 | 41 |
| 42 using WebKit::WebCString; |
39 using WebKit::WebFrame; | 43 using WebKit::WebFrame; |
40 using WebKit::WebMediaPlayerClient; | 44 using WebKit::WebMediaPlayerClient; |
41 using WebKit::WebPlugin; | 45 using WebKit::WebPlugin; |
42 using WebKit::WebPluginParams; | 46 using WebKit::WebPluginParams; |
43 using WebKit::WebString; | 47 using WebKit::WebString; |
44 using WebKit::WebURL; | 48 using WebKit::WebURL; |
45 | 49 |
46 namespace { | 50 namespace { |
47 | 51 |
48 class TestEnvironment { | 52 class TestEnvironment { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 void SetThemeEngine(WebKit::WebThemeEngine* engine) { | 336 void SetThemeEngine(WebKit::WebThemeEngine* engine) { |
333 DCHECK(test_environment); | 337 DCHECK(test_environment); |
334 test_environment->set_theme_engine(engine); | 338 test_environment->set_theme_engine(engine); |
335 } | 339 } |
336 | 340 |
337 WebKit::WebThemeEngine* GetThemeEngine() { | 341 WebKit::WebThemeEngine* GetThemeEngine() { |
338 DCHECK(test_environment); | 342 DCHECK(test_environment); |
339 return test_environment->theme_engine(); | 343 return test_environment->theme_engine(); |
340 } | 344 } |
341 | 345 |
| 346 // DevTools |
| 347 WebCString GetDevToolsInjectedScriptSource() { |
| 348 base::StringPiece injectJSWebkit = webkit_glue::GetDataResource( |
| 349 IDR_DEVTOOLS_INJECT_WEBKIT_JS); |
| 350 return WebCString(injectJSWebkit.as_string().c_str()); |
| 351 } |
| 352 |
| 353 WebCString GetDevToolsInjectedScriptDispatcherSource() { |
| 354 base::StringPiece injectDispatchJS = webkit_glue::GetDataResource( |
| 355 IDR_DEVTOOLS_INJECT_DISPATCH_JS); |
| 356 return WebCString(injectDispatchJS.as_string().c_str()); |
| 357 } |
| 358 |
| 359 WebCString GetDevToolsDebuggerScriptSource() { |
| 360 base::StringPiece debuggerScriptJS = webkit_glue::GetDataResource( |
| 361 IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS); |
| 362 return WebCString(debuggerScriptJS.as_string().c_str()); |
| 363 } |
| 364 |
| 365 WebURL GetDevToolsPathAsURL() { |
| 366 FilePath dirExe; |
| 367 if (!webkit_glue::GetExeDirectory(&dirExe)) { |
| 368 DCHECK(false); |
| 369 return WebURL(); |
| 370 } |
| 371 FilePath devToolsPath = dirExe.AppendASCII("resources/inspector/devtools.html"
); |
| 372 return GURL(devToolsPath.value()); |
| 373 } |
| 374 |
342 #endif | 375 #endif |
343 | 376 |
344 } // namespace webkit_support | 377 } // namespace webkit_support |
OLD | NEW |