| OLD | NEW |
| 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 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #import <objc/objc-runtime.h> | 9 #import <objc/objc-runtime.h> |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const char* resource_path = [[resources stringByAppendingPathComponent: | 123 const char* resource_path = [[resources stringByAppendingPathComponent: |
| 124 [NSString stringWithUTF8String:fontFileNames[i]]] UTF8String]; | 124 [NSString stringWithUTF8String:fontFileNames[i]]] UTF8String]; |
| 125 FSRef resource_ref; | 125 FSRef resource_ref; |
| 126 const UInt8* uint8_resource_path | 126 const UInt8* uint8_resource_path |
| 127 = reinterpret_cast<const UInt8*>(resource_path); | 127 = reinterpret_cast<const UInt8*>(resource_path); |
| 128 if (FSPathMakeRef(uint8_resource_path, &resource_ref, nil) != noErr) { | 128 if (FSPathMakeRef(uint8_resource_path, &resource_ref, nil) != noErr) { |
| 129 DLOG(FATAL) << "Fail to open " << resource_path; | 129 DLOG(FATAL) << "Fail to open " << resource_path; |
| 130 } | 130 } |
| 131 if (ATSFontActivateFromFileReference(&resource_ref, kATSFontContextLocal, | 131 if (ATSFontActivateFromFileReference(&resource_ref, kATSFontContextLocal, |
| 132 kATSFontFormatUnspecified, 0, kATSOptionFlagsDefault, 0) != noErr) { | 132 kATSFontFormatUnspecified, 0, kATSOptionFlagsDefault, 0) != noErr) { |
| 133 DLOG(FATAL) << "Fail to activate font: %s" << resource_path; | 133 DLOG(FATAL) << "Fail to activate font: " << resource_path; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 SwizzleNSPasteboard(); | 137 SwizzleNSPasteboard(); |
| 138 | 138 |
| 139 // Add <app bundle's parent dir>/plugins to the plugin path so we can load | 139 // Add <app bundle's parent dir>/plugins to the plugin path so we can load |
| 140 // test plugins. | 140 // test plugins. |
| 141 FilePath plugins_dir; | 141 FilePath plugins_dir; |
| 142 PathService::Get(base::DIR_EXE, &plugins_dir); | 142 PathService::Get(base::DIR_EXE, &plugins_dir); |
| 143 plugins_dir = plugins_dir.AppendASCII("../../../plugins"); | 143 plugins_dir = plugins_dir.AppendASCII("../../../plugins"); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return resize_corner_data; | 210 return resize_corner_data; |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 base::StringPiece res; | 213 base::StringPiece res; |
| 214 if (g_resource_data_pack) | 214 if (g_resource_data_pack) |
| 215 g_resource_data_pack->GetStringPiece(resource_id, &res); | 215 g_resource_data_pack->GetStringPiece(resource_id, &res); |
| 216 return res; | 216 return res; |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace webkit_glue | 219 } // namespace webkit_glue |
| OLD | NEW |