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 " \"" << *scan << "\""; | 198 " \"" << *scan << "\""; |
199 continue; | 199 continue; |
200 } | 200 } |
201 | 201 |
202 // Attempt to load both the resource pack and the dll. We return success | 202 // Attempt to load both the resource pack and the dll. We return success |
203 // only we load both. | 203 // only we load both. |
204 base::FilePath resource_pack_path = | 204 base::FilePath resource_pack_path = |
205 locales_path.Append(*scan + pack_suffix); | 205 locales_path.Append(*scan + pack_suffix); |
206 base::FilePath dll_path = locales_path.Append(*scan + dll_suffix); | 206 base::FilePath dll_path = locales_path.Append(*scan + dll_suffix); |
207 | 207 |
208 if (file_util::PathExists(resource_pack_path) && | 208 if (base::PathExists(resource_pack_path) && |
209 file_util::PathExists(dll_path)) { | 209 base::PathExists(dll_path)) { |
210 scoped_ptr<ui::DataPack> cur_data_pack( | 210 scoped_ptr<ui::DataPack> cur_data_pack( |
211 new ui::DataPack(ui::SCALE_FACTOR_100P)); | 211 new ui::DataPack(ui::SCALE_FACTOR_100P)); |
212 if (!cur_data_pack->LoadFromPath(resource_pack_path)) | 212 if (!cur_data_pack->LoadFromPath(resource_pack_path)) |
213 continue; | 213 continue; |
214 | 214 |
215 HMODULE locale_dll_handle = LoadLibraryEx(dll_path.value().c_str(), NULL, | 215 HMODULE locale_dll_handle = LoadLibraryEx(dll_path.value().c_str(), NULL, |
216 load_flags); | 216 load_flags); |
217 if (locale_dll_handle) { | 217 if (locale_dll_handle) { |
218 *dll_handle = locale_dll_handle; | 218 *dll_handle = locale_dll_handle; |
219 *language = dll_path.BaseName().RemoveExtension().value(); | 219 *language = dll_path.BaseName().RemoveExtension().value(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 // static | 263 // static |
264 std::wstring SimpleResourceLoader::Get(int message_id) { | 264 std::wstring SimpleResourceLoader::Get(int message_id) { |
265 SimpleResourceLoader* loader = SimpleResourceLoader::GetInstance(); | 265 SimpleResourceLoader* loader = SimpleResourceLoader::GetInstance(); |
266 return loader->GetLocalizedResource(message_id); | 266 return loader->GetLocalizedResource(message_id); |
267 } | 267 } |
268 | 268 |
269 HMODULE SimpleResourceLoader::GetResourceModuleHandle() { | 269 HMODULE SimpleResourceLoader::GetResourceModuleHandle() { |
270 return locale_dll_handle_; | 270 return locale_dll_handle_; |
271 } | 271 } |
OLD | NEW |