Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Side by Side Diff: webkit/tools/test_shell/test_shell_win.cc

Issue 173418: Avoids the use of ToWStringHack in a few places.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/unit/chrome_test_suite.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 698
699 // TODO(tc): Convert this to using resources from test_shell.rc. 699 // TODO(tc): Convert this to using resources from test_shell.rc.
700 StringPiece GetDataResource(int resource_id) { 700 StringPiece GetDataResource(int resource_id) {
701 switch (resource_id) { 701 switch (resource_id) {
702 case IDR_BROKENIMAGE: { 702 case IDR_BROKENIMAGE: {
703 // Use webkit's broken image icon (16x16) 703 // Use webkit's broken image icon (16x16)
704 static std::string broken_image_data; 704 static std::string broken_image_data;
705 if (broken_image_data.empty()) { 705 if (broken_image_data.empty()) {
706 FilePath path = GetResourcesFilePath(); 706 FilePath path = GetResourcesFilePath();
707 path = path.AppendASCII("missingImage.gif"); 707 path = path.AppendASCII("missingImage.gif");
708 bool success = file_util::ReadFileToString(path.ToWStringHack(), 708 bool success = file_util::ReadFileToString(path, &broken_image_data);
709 &broken_image_data);
710 if (!success) { 709 if (!success) {
711 LOG(FATAL) << "Failed reading: " << path.value(); 710 LOG(FATAL) << "Failed reading: " << path.value();
712 } 711 }
713 } 712 }
714 return broken_image_data; 713 return broken_image_data;
715 } 714 }
716 case IDR_FEED_PREVIEW: 715 case IDR_FEED_PREVIEW:
717 // It is necessary to return a feed preview template that contains 716 // It is necessary to return a feed preview template that contains
718 // a {{URL}} substring where the feed URL should go; see the code 717 // a {{URL}} substring where the feed URL should go; see the code
719 // that computes feed previews in feed_preview.cc:MakeFeedPreview. 718 // that computes feed previews in feed_preview.cc:MakeFeedPreview.
720 // This fixes issue #932714. 719 // This fixes issue #932714.
721 return "Feed preview for {{URL}}"; 720 return "Feed preview for {{URL}}";
722 case IDR_TEXTAREA_RESIZER: { 721 case IDR_TEXTAREA_RESIZER: {
723 // Use webkit's text area resizer image. 722 // Use webkit's text area resizer image.
724 static std::string resize_corner_data; 723 static std::string resize_corner_data;
725 if (resize_corner_data.empty()) { 724 if (resize_corner_data.empty()) {
726 FilePath path = GetResourcesFilePath(); 725 FilePath path = GetResourcesFilePath();
727 path = path.AppendASCII("textAreaResizeCorner.png"); 726 path = path.AppendASCII("textAreaResizeCorner.png");
728 bool success = file_util::ReadFileToString(path.ToWStringHack(), 727 bool success = file_util::ReadFileToString(path, &resize_corner_data);
729 &resize_corner_data);
730 if (!success) { 728 if (!success) {
731 LOG(FATAL) << "Failed reading: " << path.value(); 729 LOG(FATAL) << "Failed reading: " << path.value();
732 } 730 }
733 } 731 }
734 return resize_corner_data; 732 return resize_corner_data;
735 } 733 }
736 734
737 case IDR_SEARCH_CANCEL: 735 case IDR_SEARCH_CANCEL:
738 case IDR_SEARCH_CANCEL_PRESSED: 736 case IDR_SEARCH_CANCEL_PRESSED:
739 case IDR_SEARCH_MAGNIFIER: 737 case IDR_SEARCH_MAGNIFIER:
(...skipping 25 matching lines...) Expand all
765 763
766 bool EnsureFontLoaded(HFONT font) { 764 bool EnsureFontLoaded(HFONT font) {
767 return true; 765 return true;
768 } 766 }
769 767
770 bool DownloadUrl(const std::string& url, HWND caller_window) { 768 bool DownloadUrl(const std::string& url, HWND caller_window) {
771 return false; 769 return false;
772 } 770 }
773 771
774 } // namespace webkit_glue 772 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « chrome/test/unit/chrome_test_suite.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698