OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/common/resource_bundle.h" | 5 #include "chrome/common/resource_bundle.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (locale_path.value().empty()) { | 51 if (locale_path.value().empty()) { |
52 // It's possible that there are no locale dlls found, in which case we just | 52 // It's possible that there are no locale dlls found, in which case we just |
53 // return. | 53 // return. |
54 NOTREACHED(); | 54 NOTREACHED(); |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 // The dll should only have resources, not executable code. | 58 // The dll should only have resources, not executable code. |
59 locale_resources_data_ = LoadLibraryEx(locale_path.value().c_str(), NULL, | 59 locale_resources_data_ = LoadLibraryEx(locale_path.value().c_str(), NULL, |
60 GetDataDllLoadFlags()); | 60 GetDataDllLoadFlags()); |
61 DCHECK(locale_resources_data_ != NULL) << "unable to load generated resources"
; | 61 DCHECK(locale_resources_data_ != NULL) << |
| 62 "unable to load generated resources"; |
62 } | 63 } |
63 | 64 |
64 FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) { | 65 FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) { |
65 FilePath locale_path; | 66 FilePath locale_path; |
66 PathService::Get(chrome::DIR_LOCALES, &locale_path); | 67 PathService::Get(chrome::DIR_LOCALES, &locale_path); |
67 | 68 |
68 const std::wstring app_locale = l10n_util::GetApplicationLocale(pref_locale); | 69 const std::wstring app_locale = l10n_util::GetApplicationLocale(pref_locale); |
69 if (app_locale.empty()) | 70 if (app_locale.empty()) |
70 return FilePath(); | 71 return FilePath(); |
71 | 72 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 image = AtlGetStringResourceImage(_AtlBaseModule.GetModuleInstance(), | 155 image = AtlGetStringResourceImage(_AtlBaseModule.GetModuleInstance(), |
155 message_id); | 156 message_id); |
156 if (!image) { | 157 if (!image) { |
157 NOTREACHED() << "unable to find resource: " << message_id; | 158 NOTREACHED() << "unable to find resource: " << message_id; |
158 return std::wstring(); | 159 return std::wstring(); |
159 } | 160 } |
160 } | 161 } |
161 // Copy into a wstring and return. | 162 // Copy into a wstring and return. |
162 return std::wstring(image->achString, image->nLength); | 163 return std::wstring(image->achString, image->nLength); |
163 } | 164 } |
OLD | NEW |