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

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

Issue 10686005: Add methods to add DataPack from open files (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
« no previous file with comments | « webkit/support/platform_support_linux.cc ('k') | webkit/tools/test_shell/test_shell_gtk.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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void AfterInitialize(bool unit_test_mode) { 101 void AfterInitialize(bool unit_test_mode) {
102 if (unit_test_mode) 102 if (unit_test_mode)
103 return; // We don't have a resource pack when running the unit-tests. 103 return; // We don't have a resource pack when running the unit-tests.
104 104
105 // Load a data pack. 105 // Load a data pack.
106 g_resource_data_pack = new ui::DataPack(ui::SCALE_FACTOR_100P); 106 g_resource_data_pack = new ui::DataPack(ui::SCALE_FACTOR_100P);
107 NSString* resource_path = 107 NSString* resource_path =
108 [base::mac::FrameworkBundle() pathForResource:@"DumpRenderTree" 108 [base::mac::FrameworkBundle() pathForResource:@"DumpRenderTree"
109 ofType:@"pak"]; 109 ofType:@"pak"];
110 FilePath resources_pak_path([resource_path fileSystemRepresentation]); 110 FilePath resources_pak_path([resource_path fileSystemRepresentation]);
111 if (!g_resource_data_pack->Load(resources_pak_path)) { 111 if (!g_resource_data_pack->LoadFromPath(resources_pak_path)) {
112 LOG(FATAL) << "failed to load DumpRenderTree.pak"; 112 LOG(FATAL) << "failed to load DumpRenderTree.pak";
113 } 113 }
114 114
115 // Load font files in the resource folder. 115 // Load font files in the resource folder.
116 static const char* const fontFileNames[] = { 116 static const char* const fontFileNames[] = {
117 "AHEM____.TTF", 117 "AHEM____.TTF",
118 // We don't register WebKitWeightWather fonts because of 118 // We don't register WebKitWeightWather fonts because of
119 // webkit.org/b/50709. 119 // webkit.org/b/50709.
120 }; 120 };
121 121
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 } 249 }
250 return resize_corner_data; 250 return resize_corner_data;
251 } 251 }
252 } 252 }
253 base::StringPiece res; 253 base::StringPiece res;
254 if (g_resource_data_pack) 254 if (g_resource_data_pack)
255 g_resource_data_pack->GetStringPiece(resource_id, &res); 255 g_resource_data_pack->GetStringPiece(resource_id, &res);
256 return res; 256 return res;
257 } 257 }
OLDNEW
« no previous file with comments | « webkit/support/platform_support_linux.cc ('k') | webkit/tools/test_shell/test_shell_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698