OLD | NEW |
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 "chrome_frame/simple_resource_loader.h" | 5 #include "chrome_frame/simple_resource_loader.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 continue; | 198 continue; |
199 } | 199 } |
200 | 200 |
201 // Attempt to load both the resource pack and the dll. We return success | 201 // Attempt to load both the resource pack and the dll. We return success |
202 // only we load both. | 202 // only we load both. |
203 FilePath resource_pack_path = locales_path.Append(*scan + pack_suffix); | 203 FilePath resource_pack_path = locales_path.Append(*scan + pack_suffix); |
204 FilePath dll_path = locales_path.Append(*scan + dll_suffix); | 204 FilePath dll_path = locales_path.Append(*scan + dll_suffix); |
205 | 205 |
206 if (file_util::PathExists(resource_pack_path) && | 206 if (file_util::PathExists(resource_pack_path) && |
207 file_util::PathExists(dll_path)) { | 207 file_util::PathExists(dll_path)) { |
208 scoped_ptr<ui::DataPack> cur_data_pack(new ui::DataPack()); | 208 scoped_ptr<ui::DataPack> cur_data_pack( |
| 209 new ui::DataPack(ui::ResourceHandle::kScaleFactor100x)); |
209 if (!cur_data_pack->Load(resource_pack_path)) | 210 if (!cur_data_pack->Load(resource_pack_path)) |
210 continue; | 211 continue; |
211 | 212 |
212 HMODULE locale_dll_handle = LoadLibraryEx(dll_path.value().c_str(), NULL, | 213 HMODULE locale_dll_handle = LoadLibraryEx(dll_path.value().c_str(), NULL, |
213 load_flags); | 214 load_flags); |
214 if (locale_dll_handle) { | 215 if (locale_dll_handle) { |
215 *dll_handle = locale_dll_handle; | 216 *dll_handle = locale_dll_handle; |
216 *language = dll_path.BaseName().RemoveExtension().value(); | 217 *language = dll_path.BaseName().RemoveExtension().value(); |
217 *data_pack = cur_data_pack.release(); | 218 *data_pack = cur_data_pack.release(); |
218 found_pack = true; | 219 found_pack = true; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 260 |
260 // static | 261 // static |
261 std::wstring SimpleResourceLoader::Get(int message_id) { | 262 std::wstring SimpleResourceLoader::Get(int message_id) { |
262 SimpleResourceLoader* loader = SimpleResourceLoader::GetInstance(); | 263 SimpleResourceLoader* loader = SimpleResourceLoader::GetInstance(); |
263 return loader->GetLocalizedResource(message_id); | 264 return loader->GetLocalizedResource(message_id); |
264 } | 265 } |
265 | 266 |
266 HMODULE SimpleResourceLoader::GetResourceModuleHandle() { | 267 HMODULE SimpleResourceLoader::GetResourceModuleHandle() { |
267 return locale_dll_handle_; | 268 return locale_dll_handle_; |
268 } | 269 } |
OLD | NEW |