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 #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" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/resource_util.h" | |
13 #include "base/string16.h" | 12 #include "base/string16.h" |
14 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 14 #include "base/win/resource_util.h" |
15 #include "grit/webkit_chromium_resources.h" | 15 #include "grit/webkit_chromium_resources.h" |
16 #include "grit/webkit_resources.h" | 16 #include "grit/webkit_resources.h" |
17 | 17 |
18 #define MAX_LOADSTRING 100 | 18 #define MAX_LOADSTRING 100 |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 FilePath GetResourceFilePath(const char* ascii_name) { | 22 FilePath GetResourceFilePath(const char* ascii_name) { |
23 FilePath path; | 23 FilePath path; |
24 PathService::Get(base::DIR_EXE, &path); | 24 PathService::Get(base::DIR_EXE, &path); |
25 path = path.AppendASCII("DumpRenderTree_resources"); | 25 path = path.AppendASCII("DumpRenderTree_resources"); |
26 return path.AppendASCII(ascii_name); | 26 return path.AppendASCII(ascii_name); |
27 } | 27 } |
28 | 28 |
29 base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { | 29 base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { |
30 void* data_ptr; | 30 void* data_ptr; |
31 size_t data_size; | 31 size_t data_size; |
32 return base::GetDataResourceFromModule(module, resource_id, &data_ptr, | 32 return base::win::GetDataResourceFromModule(module, resource_id, &data_ptr, |
33 &data_size) | 33 &data_size) |
34 ? base::StringPiece(static_cast<char*>(data_ptr), data_size) | 34 ? base::StringPiece(static_cast<char*>(data_ptr), data_size) |
35 : base::StringPiece(); | 35 : base::StringPiece(); |
36 } | 36 } |
37 | 37 |
38 base::StringPiece ResourceProvider(int key) { | 38 base::StringPiece ResourceProvider(int key) { |
39 return GetRawDataResource(::GetModuleHandle(NULL), key); | 39 return GetRawDataResource(::GetModuleHandle(NULL), key); |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 } | 99 } |
100 return resize_corner_data; | 100 return resize_corner_data; |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 return ResourceProvider(resource_id); | 104 return ResourceProvider(resource_id); |
105 } | 105 } |
106 | 106 |
107 } // namespace webkit_glue | 107 } // namespace webkit_glue |
OLD | NEW |