OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <fontconfig/fontconfig.h> | 9 #include <fontconfig/fontconfig.h> |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
28 #include "ui/base/gtk/gtk_compat.h" | 28 #include "ui/base/gtk/gtk_compat.h" |
29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
30 #include "webkit/glue/resource_loader_bridge.h" | 30 #include "webkit/glue/resource_loader_bridge.h" |
31 #include "webkit/glue/webkit_glue.h" | 31 #include "webkit/glue/webkit_glue.h" |
32 #include "webkit/glue/webpreferences.h" | 32 #include "webkit/glue/webpreferences.h" |
33 #include "webkit/plugins/npapi/plugin_list.h" | 33 #include "webkit/plugins/npapi/plugin_list.h" |
34 #include "webkit/tools/test_shell/test_navigation_controller.h" | 34 #include "webkit/tools/test_shell/test_navigation_controller.h" |
| 35 #include "webkit/tools/test_shell/test_shell_webkit_init.h" |
35 #include "webkit/tools/test_shell/test_webview_delegate.h" | 36 #include "webkit/tools/test_shell/test_webview_delegate.h" |
36 | 37 |
37 using WebKit::WebPoint; | 38 using WebKit::WebPoint; |
38 using WebKit::WebWidget; | 39 using WebKit::WebWidget; |
39 | 40 |
40 namespace { | 41 namespace { |
41 | 42 |
42 // Convert a FilePath into an FcChar* (used by fontconfig). | 43 // Convert a FilePath into an FcChar* (used by fontconfig). |
43 // The pointer only lives for the duration for the expression. | 44 // The pointer only lives for the duration for the expression. |
44 const FcChar8* FilePathAsFcChar(const FilePath& path) { | 45 const FcChar8* FilePathAsFcChar(const FilePath& path) { |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 gtk_widget_destroy(dialog); | 556 gtk_widget_destroy(dialog); |
556 } | 557 } |
557 | 558 |
558 // static | 559 // static |
559 base::StringPiece TestShell::ResourceProvider(int key) { | 560 base::StringPiece TestShell::ResourceProvider(int key) { |
560 return ResourceBundle::GetSharedInstance().GetRawDataResource(key); | 561 return ResourceBundle::GetSharedInstance().GetRawDataResource(key); |
561 } | 562 } |
562 | 563 |
563 //----------------------------------------------------------------------------- | 564 //----------------------------------------------------------------------------- |
564 | 565 |
565 namespace webkit_glue { | 566 string16 TestShellWebKitInit::GetLocalizedString(int message_id) { |
566 | |
567 string16 GetLocalizedString(int message_id) { | |
568 return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); | 567 return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); |
569 } | 568 } |
570 | 569 |
571 base::StringPiece GetDataResource(int resource_id) { | 570 base::StringPiece TestShellWebKitInit::GetDataResource(int resource_id) { |
572 switch (resource_id) { | 571 switch (resource_id) { |
573 case IDR_BROKENIMAGE: | 572 case IDR_BROKENIMAGE: |
574 resource_id = IDR_BROKENIMAGE_TESTSHELL; | 573 resource_id = IDR_BROKENIMAGE_TESTSHELL; |
575 break; | 574 break; |
576 case IDR_TEXTAREA_RESIZER: | 575 case IDR_TEXTAREA_RESIZER: |
577 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; | 576 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; |
578 break; | 577 break; |
579 } | 578 } |
580 return TestShell::ResourceProvider(resource_id); | 579 return TestShell::ResourceProvider(resource_id); |
581 } | 580 } |
582 | |
583 } // namespace webkit_glue | |
OLD | NEW |