| 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 "app/resource_bundle.h" | 5 #include "app/resource_bundle.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 | 8 |
| 9 #include "app/app_paths.h" | 9 #include "app/app_paths.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "base/data_pack.h" | 11 #include "base/data_pack.h" |
| 12 #include "base/debug_util.h" | 12 #include "base/debug_util.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/lock.h" | 14 #include "base/lock.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/resource_util.h" | 17 #include "base/resource_util.h" |
| 18 #include "base/stl_util-inl.h" | 18 #include "base/stl_util-inl.h" |
| 19 #include "base/string_piece.h" | 19 #include "base/string_piece.h" |
| 20 #include "base/win_util.h" | 20 #include "base/win/windows_version.h" |
| 21 |
| 21 #include "gfx/font.h" | 22 #include "gfx/font.h" |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 // Returns the flags that should be passed to LoadLibraryEx. | 26 // Returns the flags that should be passed to LoadLibraryEx. |
| 26 DWORD GetDataDllLoadFlags() { | 27 DWORD GetDataDllLoadFlags() { |
| 27 if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) | 28 if (base::win::GetVersion() >= base::win::VERSION_VISTA) |
| 28 return LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE | LOAD_LIBRARY_AS_IMAGE_RESOURCE; | 29 return LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE | LOAD_LIBRARY_AS_IMAGE_RESOURCE; |
| 29 | 30 |
| 30 return DONT_RESOLVE_DLL_REFERENCES; | 31 return DONT_RESOLVE_DLL_REFERENCES; |
| 31 } | 32 } |
| 32 | 33 |
| 33 } // end anonymous namespace | 34 } // end anonymous namespace |
| 34 | 35 |
| 35 ResourceBundle::~ResourceBundle() { | 36 ResourceBundle::~ResourceBundle() { |
| 36 FreeImages(); | 37 FreeImages(); |
| 37 UnloadLocaleResources(); | 38 UnloadLocaleResources(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 message_id); | 157 message_id); |
| 157 if (!image) { | 158 if (!image) { |
| 158 StackTrace().PrintBacktrace(); // See http://crbug.com/21925. | 159 StackTrace().PrintBacktrace(); // See http://crbug.com/21925. |
| 159 NOTREACHED() << "unable to find resource: " << message_id; | 160 NOTREACHED() << "unable to find resource: " << message_id; |
| 160 return std::wstring(); | 161 return std::wstring(); |
| 161 } | 162 } |
| 162 } | 163 } |
| 163 // Copy into a string16 and return. | 164 // Copy into a string16 and return. |
| 164 return string16(image->achString, image->nLength); | 165 return string16(image->achString, image->nLength); |
| 165 } | 166 } |
| OLD | NEW |