OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windows.h> | 7 #include <windows.h> |
8 #include <commdlg.h> | 8 #include <commdlg.h> |
9 #include <objbase.h> | 9 #include <objbase.h> |
10 #include <process.h> | 10 #include <process.h> |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 wchar_t localized[MAX_LOADSTRING]; | 662 wchar_t localized[MAX_LOADSTRING]; |
663 int length = LoadString(GetModuleHandle(NULL), message_id, | 663 int length = LoadString(GetModuleHandle(NULL), message_id, |
664 localized, MAX_LOADSTRING); | 664 localized, MAX_LOADSTRING); |
665 if (!length && GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND) { | 665 if (!length && GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND) { |
666 NOTREACHED(); | 666 NOTREACHED(); |
667 return L"No string for this identifier!"; | 667 return L"No string for this identifier!"; |
668 } | 668 } |
669 return string16(localized, length); | 669 return string16(localized, length); |
670 } | 670 } |
671 | 671 |
| 672 base::StringPiece TestShellWebKitInit::GetDataResource(int resource_id) { |
| 673 return base::StringPiece(); |
| 674 } |
| 675 |
672 // TODO(tc): Convert this to using resources from test_shell.rc. | 676 // TODO(tc): Convert this to using resources from test_shell.rc. |
673 base::StringPiece TestShellWebKitInit::GetDataResource(int resource_id) { | 677 base::StringPiece TestShellWebKitInit::GetImageResource(int resource_id, |
| 678 float scale_factor) { |
674 switch (resource_id) { | 679 switch (resource_id) { |
675 case IDR_BROKENIMAGE: { | 680 case IDR_BROKENIMAGE: { |
676 // Use webkit's broken image icon (16x16) | 681 // Use webkit's broken image icon (16x16) |
677 static std::string broken_image_data; | 682 static std::string broken_image_data; |
678 if (broken_image_data.empty()) { | 683 if (broken_image_data.empty()) { |
679 FilePath path = GetResourcesFilePath(); | 684 FilePath path = GetResourcesFilePath(); |
680 path = path.AppendASCII("missingImage.gif"); | 685 path = path.AppendASCII("missingImage.gif"); |
681 bool success = file_util::ReadFileToString(path, &broken_image_data); | 686 bool success = file_util::ReadFileToString(path, &broken_image_data); |
682 if (!success) { | 687 if (!success) { |
683 LOG(FATAL) << "Failed reading: " << path.value(); | 688 LOG(FATAL) << "Failed reading: " << path.value(); |
(...skipping 23 matching lines...) Expand all Loading... |
707 case IDR_MEDIA_PLAY_BUTTON: | 712 case IDR_MEDIA_PLAY_BUTTON: |
708 case IDR_MEDIA_PLAY_BUTTON_DISABLED: | 713 case IDR_MEDIA_PLAY_BUTTON_DISABLED: |
709 case IDR_MEDIA_SOUND_FULL_BUTTON: | 714 case IDR_MEDIA_SOUND_FULL_BUTTON: |
710 case IDR_MEDIA_SOUND_NONE_BUTTON: | 715 case IDR_MEDIA_SOUND_NONE_BUTTON: |
711 case IDR_MEDIA_SOUND_DISABLED: | 716 case IDR_MEDIA_SOUND_DISABLED: |
712 case IDR_MEDIA_SLIDER_THUMB: | 717 case IDR_MEDIA_SLIDER_THUMB: |
713 case IDR_MEDIA_VOLUME_SLIDER_THUMB: | 718 case IDR_MEDIA_VOLUME_SLIDER_THUMB: |
714 case IDR_INPUT_SPEECH: | 719 case IDR_INPUT_SPEECH: |
715 case IDR_INPUT_SPEECH_RECORDING: | 720 case IDR_INPUT_SPEECH_RECORDING: |
716 case IDR_INPUT_SPEECH_WAITING: | 721 case IDR_INPUT_SPEECH_WAITING: |
| 722 //TODO(flackr): Pass scale_factor. |
717 return TestShell::ResourceProvider(resource_id); | 723 return TestShell::ResourceProvider(resource_id); |
718 | 724 |
719 default: | 725 default: |
720 break; | 726 break; |
721 } | 727 } |
722 | 728 |
723 return base::StringPiece(); | 729 return base::StringPiece(); |
724 } | 730 } |
725 | 731 |
726 ///////////////////////////////////////////////////////////////////////////// | 732 ///////////////////////////////////////////////////////////////////////////// |
727 // WebKit glue functions | 733 // WebKit glue functions |
728 | 734 |
729 namespace webkit_glue { | 735 namespace webkit_glue { |
730 | 736 |
731 bool EnsureFontLoaded(HFONT font) { | 737 bool EnsureFontLoaded(HFONT font) { |
732 return true; | 738 return true; |
733 } | 739 } |
734 | 740 |
735 bool DownloadUrl(const std::string& url, HWND caller_window) { | 741 bool DownloadUrl(const std::string& url, HWND caller_window) { |
736 return false; | 742 return false; |
737 } | 743 } |
738 | 744 |
739 } // namespace webkit_glue | 745 } // namespace webkit_glue |
OLD | NEW |