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

Side by Side Diff: webkit/support/platform_support_mac.mm

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_linux.cc ('k') | webkit/support/platform_support_win.cc » ('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) 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/support/platform_support.h" 5 #include "webkit/support/platform_support.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 #include <AvailabilityMacros.h> 8 #include <AvailabilityMacros.h>
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 #import <objc/objc-runtime.h> 10 #import <objc/objc-runtime.h>
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // We assume the application is bundled. 210 // We assume the application is bundled.
211 if (!base::mac::AmIBundled()) { 211 if (!base::mac::AmIBundled()) {
212 LOG(FATAL) << "Failed to locate resources. The applicaiton is not bundled."; 212 LOG(FATAL) << "Failed to locate resources. The applicaiton is not bundled.";
213 } 213 }
214 PathService::Get(base::DIR_EXE, &path); 214 PathService::Get(base::DIR_EXE, &path);
215 path = path.Append(FilePath::kParentDirectory); 215 path = path.Append(FilePath::kParentDirectory);
216 return path.AppendASCII("Resources"); 216 return path.AppendASCII("Resources");
217 } 217 }
218 218
219 base::StringPiece TestWebKitPlatformSupport::GetDataResource(int resource_id) { 219 base::StringPiece TestWebKitPlatformSupport::GetDataResource(int resource_id) {
220 base::StringPiece res;
221 if (g_resource_data_pack)
222 g_resource_data_pack->GetStringPiece(resource_id, &res);
223 return res;
224 }
225
226 base::StringPiece TestWebKitPlatformSupport::GetImageResource(
227 int resource_id,
228 float scale_factor) {
220 switch (resource_id) { 229 switch (resource_id) {
221 case IDR_BROKENIMAGE: { 230 case IDR_BROKENIMAGE: {
222 // Use webkit's broken image icon (16x16) 231 // Use webkit's broken image icon (16x16)
223 CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ()); 232 CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ());
224 if (broken_image_data.empty()) { 233 if (broken_image_data.empty()) {
225 FilePath path = GetResourcesFilePath(); 234 FilePath path = GetResourcesFilePath();
226 // In order to match WebKit's colors for the missing image, we have to 235 // In order to match WebKit's colors for the missing image, we have to
227 // use a PNG. The GIF doesn't have the color range needed to correctly 236 // use a PNG. The GIF doesn't have the color range needed to correctly
228 // match the TIFF they use in Safari. 237 // match the TIFF they use in Safari.
229 path = path.AppendASCII("missingImage.png"); 238 path = path.AppendASCII("missingImage.png");
(...skipping 16 matching lines...) Expand all
246 } 255 }
247 } 256 }
248 return resize_corner_data; 257 return resize_corner_data;
249 } 258 }
250 } 259 }
251 base::StringPiece res; 260 base::StringPiece res;
252 if (g_resource_data_pack) 261 if (g_resource_data_pack)
253 g_resource_data_pack->GetStringPiece(resource_id, &res); 262 g_resource_data_pack->GetStringPiece(resource_id, &res);
254 return res; 263 return res;
255 } 264 }
OLDNEW
« no previous file with comments | « webkit/support/platform_support_linux.cc ('k') | webkit/support/platform_support_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698