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

Side by Side Diff: webkit/support/platform_support_win.cc

Issue 10383006: Add scale factor and 2x resources from webkit and plumb through to ContentClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add more test class GetImageResource methods. Created 8 years, 7 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 | « webkit/support/platform_support_mac.mm ('k') | webkit/support/test_webkit_platform_support.h » ('j') | 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) 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/support/platform_support.h" 5 #include "webkit/support/platform_support.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 int length = ::LoadString(::GetModuleHandle(NULL), message_id, 66 int length = ::LoadString(::GetModuleHandle(NULL), message_id,
67 localized, MAX_LOADSTRING); 67 localized, MAX_LOADSTRING);
68 if (!length && ::GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND) { 68 if (!length && ::GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND) {
69 NOTREACHED(); 69 NOTREACHED();
70 return L"No string for this identifier!"; 70 return L"No string for this identifier!";
71 } 71 }
72 return string16(localized, length); 72 return string16(localized, length);
73 } 73 }
74 74
75 base::StringPiece TestWebKitPlatformSupport::GetDataResource(int resource_id) { 75 base::StringPiece TestWebKitPlatformSupport::GetDataResource(int resource_id) {
76 return ResourceProvider(resource_id);
77 }
78
79 base::StringPiece TestWebKitPlatformSupport::GetImageResource(
80 int resource_id,
81 float scale_factor) {
76 switch (resource_id) { 82 switch (resource_id) {
77 case IDR_BROKENIMAGE: { 83 case IDR_BROKENIMAGE: {
78 // Use webkit's broken image icon (16x16) 84 // Use webkit's broken image icon (16x16)
79 static std::string broken_image_data; 85 static std::string broken_image_data;
80 if (broken_image_data.empty()) { 86 if (broken_image_data.empty()) {
81 FilePath path = GetResourceFilePath("missingImage.gif"); 87 FilePath path = GetResourceFilePath("missingImage.gif");
82 bool success = file_util::ReadFileToString(path, &broken_image_data); 88 bool success = file_util::ReadFileToString(path, &broken_image_data);
83 if (!success) { 89 if (!success) {
84 LOG(FATAL) << "Failed reading: " << path.value(); 90 LOG(FATAL) << "Failed reading: " << path.value();
85 } 91 }
86 } 92 }
87 return broken_image_data; 93 return broken_image_data;
88 } 94 }
89 case IDR_TEXTAREA_RESIZER: { 95 case IDR_TEXTAREA_RESIZER: {
90 // Use webkit's text area resizer image. 96 // Use webkit's text area resizer image.
91 static std::string resize_corner_data; 97 static std::string resize_corner_data;
92 if (resize_corner_data.empty()) { 98 if (resize_corner_data.empty()) {
93 FilePath path = GetResourceFilePath("textAreaResizeCorner.png"); 99 FilePath path = GetResourceFilePath("textAreaResizeCorner.png");
94 bool success = file_util::ReadFileToString(path, &resize_corner_data); 100 bool success = file_util::ReadFileToString(path, &resize_corner_data);
95 if (!success) { 101 if (!success) {
96 LOG(FATAL) << "Failed reading: " << path.value(); 102 LOG(FATAL) << "Failed reading: " << path.value();
97 } 103 }
98 } 104 }
99 return resize_corner_data; 105 return resize_corner_data;
100 } 106 }
101 } 107 }
102 108
109 // TODO(flackr): Pass scale_factor to ResourceProvider.
103 return ResourceProvider(resource_id); 110 return ResourceProvider(resource_id);
104 } 111 }
OLDNEW
« no previous file with comments | « webkit/support/platform_support_mac.mm ('k') | webkit/support/test_webkit_platform_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698