| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| 11 #include "app/data_pack.h" |
| 11 #include "base/base_paths.h" | 12 #include "base/base_paths.h" |
| 12 #include "base/data_pack.h" | |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/mac_util.h" | 15 #include "base/mac_util.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/string16.h" | 17 #include "base/string16.h" |
| 18 #include "grit/webkit_resources.h" | 18 #include "grit/webkit_resources.h" |
| 19 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" | 19 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" |
| 20 #include "webkit/plugins/npapi/plugin_list.h" | 20 #include "webkit/plugins/npapi/plugin_list.h" |
| 21 #import "webkit/support/drt_application_mac.h" | 21 #import "webkit/support/drt_application_mac.h" |
| 22 #import "webkit/tools/test_shell/mac/DumpRenderTreePasteboard.h" | 22 #import "webkit/tools/test_shell/mac/DumpRenderTreePasteboard.h" |
| 23 | 23 |
| 24 static base::DataPack* g_resource_data_pack = NULL; | 24 static app::DataPack* g_resource_data_pack = NULL; |
| 25 | 25 |
| 26 namespace webkit_support { | 26 namespace webkit_support { |
| 27 | 27 |
| 28 static NSAutoreleasePool* autorelease_pool; | 28 static NSAutoreleasePool* autorelease_pool; |
| 29 | 29 |
| 30 void BeforeInitialize(bool unit_test_mode) { | 30 void BeforeInitialize(bool unit_test_mode) { |
| 31 [CrDrtApplication sharedApplication]; | 31 [CrDrtApplication sharedApplication]; |
| 32 // Need to initialize NSAutoreleasePool before InitWebCoreSystemInterface(). | 32 // Need to initialize NSAutoreleasePool before InitWebCoreSystemInterface(). |
| 33 autorelease_pool = [[NSAutoreleasePool alloc] init]; | 33 autorelease_pool = [[NSAutoreleasePool alloc] init]; |
| 34 DCHECK(autorelease_pool); | 34 DCHECK(autorelease_pool); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 SwizzleAllMethods(object_getClass(imposterClass), | 95 SwizzleAllMethods(object_getClass(imposterClass), |
| 96 object_getClass(originalClass)); | 96 object_getClass(originalClass)); |
| 97 #endif | 97 #endif |
| 98 } | 98 } |
| 99 | 99 |
| 100 void AfterInitialize(bool unit_test_mode) { | 100 void AfterInitialize(bool unit_test_mode) { |
| 101 if (unit_test_mode) | 101 if (unit_test_mode) |
| 102 return; // We don't have a resource pack when running the unit-tests. | 102 return; // We don't have a resource pack when running the unit-tests. |
| 103 | 103 |
| 104 // Load a data pack. | 104 // Load a data pack. |
| 105 g_resource_data_pack = new base::DataPack; | 105 g_resource_data_pack = new app::DataPack; |
| 106 NSString* resource_path = | 106 NSString* resource_path = |
| 107 [mac_util::MainAppBundle() pathForResource:@"DumpRenderTree" | 107 [mac_util::MainAppBundle() pathForResource:@"DumpRenderTree" |
| 108 ofType:@"pak"]; | 108 ofType:@"pak"]; |
| 109 FilePath resources_pak_path([resource_path fileSystemRepresentation]); | 109 FilePath resources_pak_path([resource_path fileSystemRepresentation]); |
| 110 if (!g_resource_data_pack->Load(resources_pak_path)) { | 110 if (!g_resource_data_pack->Load(resources_pak_path)) { |
| 111 LOG(FATAL) << "failed to load DumpRenderTree.pak"; | 111 LOG(FATAL) << "failed to load DumpRenderTree.pak"; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Load font files in the resource folder. | 114 // Load font files in the resource folder. |
| 115 static const char* const fontFileNames[] = { | 115 static const char* const fontFileNames[] = { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return res; | 234 return res; |
| 235 } | 235 } |
| 236 | 236 |
| 237 default: | 237 default: |
| 238 break; | 238 break; |
| 239 } | 239 } |
| 240 return base::StringPiece(); | 240 return base::StringPiece(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace webkit_glue | 243 } // namespace webkit_glue |
| OLD | NEW |