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 "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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 // static | 619 // static |
620 void TestShell::ShowStartupDebuggingDialog() { | 620 void TestShell::ShowStartupDebuggingDialog() { |
621 GtkWidget* dialog = gtk_message_dialog_new( | 621 GtkWidget* dialog = gtk_message_dialog_new( |
622 NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "attach to me?"); | 622 NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "attach to me?"); |
623 gtk_window_set_title(GTK_WINDOW(dialog), "test_shell"); | 623 gtk_window_set_title(GTK_WINDOW(dialog), "test_shell"); |
624 gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop. | 624 gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop. |
625 gtk_widget_destroy(dialog); | 625 gtk_widget_destroy(dialog); |
626 } | 626 } |
627 | 627 |
628 // static | 628 // static |
629 base::StringPiece TestShell::NetResourceProvider(int key) { | 629 base::StringPiece TestShell::ResourceProvider(int key) { |
630 base::StringPiece res; | 630 base::StringPiece res; |
631 g_resource_data_pack->GetStringPiece(key, &res); | 631 g_resource_data_pack->GetStringPiece(key, &res); |
632 return res; | 632 return res; |
633 } | 633 } |
634 | 634 |
635 //----------------------------------------------------------------------------- | 635 //----------------------------------------------------------------------------- |
636 | 636 |
637 namespace webkit_glue { | 637 namespace webkit_glue { |
638 | 638 |
639 string16 GetLocalizedString(int message_id) { | 639 string16 GetLocalizedString(int message_id) { |
640 base::StringPiece res; | 640 base::StringPiece res; |
641 if (!g_resource_data_pack->GetStringPiece(message_id, &res)) { | 641 if (!g_resource_data_pack->GetStringPiece(message_id, &res)) { |
642 LOG(FATAL) << "failed to load webkit string with id " << message_id; | 642 LOG(FATAL) << "failed to load webkit string with id " << message_id; |
643 } | 643 } |
644 | 644 |
645 return string16(reinterpret_cast<const char16*>(res.data()), | 645 return string16(reinterpret_cast<const char16*>(res.data()), |
646 res.length() / 2); | 646 res.length() / 2); |
647 } | 647 } |
648 | 648 |
649 base::StringPiece GetDataResource(int resource_id) { | 649 base::StringPiece GetDataResource(int resource_id) { |
650 switch (resource_id) { | 650 switch (resource_id) { |
651 case IDR_BROKENIMAGE: | 651 case IDR_BROKENIMAGE: |
652 resource_id = IDR_BROKENIMAGE_TESTSHELL; | 652 resource_id = IDR_BROKENIMAGE_TESTSHELL; |
653 break; | 653 break; |
654 case IDR_TEXTAREA_RESIZER: | 654 case IDR_TEXTAREA_RESIZER: |
655 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; | 655 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; |
656 break; | 656 break; |
657 } | 657 } |
658 return TestShell::NetResourceProvider(resource_id); | 658 return TestShell::ResourceProvider(resource_id); |
659 } | 659 } |
660 | 660 |
661 } // namespace webkit_glue | 661 } // namespace webkit_glue |
OLD | NEW |