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 <ApplicationServices/ApplicationServices.h> | 5 #include <ApplicationServices/ApplicationServices.h> |
6 #import <Cocoa/Cocoa.h> | 6 #import <Cocoa/Cocoa.h> |
7 #import <objc/objc-runtime.h> | 7 #import <objc/objc-runtime.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include "webkit/tools/test_shell/test_shell.h" | 10 #include "webkit/tools/test_shell/test_shell.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 break; | 624 break; |
625 case ui::DataPack::BINARY: | 625 case ui::DataPack::BINARY: |
626 NOTREACHED(); | 626 NOTREACHED(); |
627 break; | 627 break; |
628 } | 628 } |
629 | 629 |
630 return msg; | 630 return msg; |
631 } | 631 } |
632 | 632 |
633 base::StringPiece TestShellWebKitInit::GetDataResource(int resource_id) { | 633 base::StringPiece TestShellWebKitInit::GetDataResource(int resource_id) { |
| 634 return base::StringPiece(); |
| 635 } |
| 636 |
| 637 base::StringPiece TestShellWebKitInit::GetImageResource(int resource_id, |
| 638 float scale_factor) { |
634 switch (resource_id) { | 639 switch (resource_id) { |
635 case IDR_BROKENIMAGE: { | 640 case IDR_BROKENIMAGE: { |
636 // Use webkit's broken image icon (16x16) | 641 // Use webkit's broken image icon (16x16) |
637 static std::string broken_image_data; | 642 static std::string broken_image_data; |
638 if (broken_image_data.empty()) { | 643 if (broken_image_data.empty()) { |
639 FilePath path = GetResourcesFilePath(); | 644 FilePath path = GetResourcesFilePath(); |
640 // In order to match WebKit's colors for the missing image, we have to | 645 // In order to match WebKit's colors for the missing image, we have to |
641 // use a PNG. The GIF doesn't have the color range needed to correctly | 646 // use a PNG. The GIF doesn't have the color range needed to correctly |
642 // match the TIFF they use in Safari. | 647 // match the TIFF they use in Safari. |
643 path = path.AppendASCII("missingImage.png"); | 648 path = path.AppendASCII("missingImage.png"); |
(...skipping 26 matching lines...) Expand all Loading... |
670 case IDR_MEDIA_PLAY_BUTTON: | 675 case IDR_MEDIA_PLAY_BUTTON: |
671 case IDR_MEDIA_PLAY_BUTTON_DISABLED: | 676 case IDR_MEDIA_PLAY_BUTTON_DISABLED: |
672 case IDR_MEDIA_SOUND_FULL_BUTTON: | 677 case IDR_MEDIA_SOUND_FULL_BUTTON: |
673 case IDR_MEDIA_SOUND_NONE_BUTTON: | 678 case IDR_MEDIA_SOUND_NONE_BUTTON: |
674 case IDR_MEDIA_SOUND_DISABLED: | 679 case IDR_MEDIA_SOUND_DISABLED: |
675 case IDR_MEDIA_SLIDER_THUMB: | 680 case IDR_MEDIA_SLIDER_THUMB: |
676 case IDR_MEDIA_VOLUME_SLIDER_THUMB: | 681 case IDR_MEDIA_VOLUME_SLIDER_THUMB: |
677 case IDR_INPUT_SPEECH: | 682 case IDR_INPUT_SPEECH: |
678 case IDR_INPUT_SPEECH_RECORDING: | 683 case IDR_INPUT_SPEECH_RECORDING: |
679 case IDR_INPUT_SPEECH_WAITING: | 684 case IDR_INPUT_SPEECH_WAITING: |
| 685 // TODO(flackr): Pass scale_factor to ResourceProvider. |
680 return TestShell::ResourceProvider(resource_id); | 686 return TestShell::ResourceProvider(resource_id); |
681 | 687 |
682 default: | 688 default: |
683 break; | 689 break; |
684 } | 690 } |
685 | 691 |
686 return base::StringPiece(); | 692 return base::StringPiece(); |
687 } | 693 } |
688 | 694 |
689 namespace webkit_glue { | 695 namespace webkit_glue { |
690 | 696 |
691 bool DownloadUrl(const std::string& url, NSWindow* caller_window) { | 697 bool DownloadUrl(const std::string& url, NSWindow* caller_window) { |
692 return false; | 698 return false; |
693 } | 699 } |
694 | 700 |
695 void DidLoadPlugin(const std::string& filename) { | 701 void DidLoadPlugin(const std::string& filename) { |
696 } | 702 } |
697 | 703 |
698 void DidUnloadPlugin(const std::string& filename) { | 704 void DidUnloadPlugin(const std::string& filename) { |
699 } | 705 } |
700 | 706 |
701 } // namespace webkit_glue | 707 } // namespace webkit_glue |
OLD | NEW |