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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 // Return the global resource loader instance. | 82 // Return the global resource loader instance. |
83 static ResourceBundle& GetSharedInstance(); | 83 static ResourceBundle& GetSharedInstance(); |
84 | 84 |
85 // Check if the .pak for the given locale exists. | 85 // Check if the .pak for the given locale exists. |
86 static bool LocaleDataPakExists(const std::string& locale); | 86 static bool LocaleDataPakExists(const std::string& locale); |
87 | 87 |
88 // Registers additional data pack files with the global ResourceBundle. When | 88 // Registers additional data pack files with the global ResourceBundle. When |
89 // looking for a DataResource, we will search these files after searching the | 89 // looking for a DataResource, we will search these files after searching the |
90 // main module. This method is not thread safe! You should call it | 90 // main module. This method is not thread safe! You should call it |
91 // immediately after calling InitSharedInstance. | 91 // immediately after calling InitSharedInstance. |
92 void AddDataPack(const FilePath& path); | 92 void AddDataPack(const FilePath& path, float scale_factor); |
sky
2012/04/25 21:11:42
Document scale_factor.
sail
2012/04/25 22:18:35
Done.
| |
93 | 93 |
94 // Changes the locale for an already-initialized ResourceBundle, returning the | 94 // Changes the locale for an already-initialized ResourceBundle, returning the |
95 // name of the newly-loaded locale. Future calls to get strings will return | 95 // name of the newly-loaded locale. Future calls to get strings will return |
96 // the strings for this new locale. This has no effect on existing or future | 96 // the strings for this new locale. This has no effect on existing or future |
97 // image resources. |locale_resources_data_| is protected by a lock for the | 97 // image resources. |locale_resources_data_| is protected by a lock for the |
98 // duration of the swap, as GetLocalizedString() may be concurrently invoked | 98 // duration of the swap, as GetLocalizedString() may be concurrently invoked |
99 // on another thread. | 99 // on another thread. |
100 std::string ReloadLocaleResources(const std::string& pref_locale); | 100 std::string ReloadLocaleResources(const std::string& pref_locale); |
101 | 101 |
102 // Gets the bitmap with the specified resource_id from the current module | 102 // Gets the bitmap with the specified resource_id from the current module |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 | 220 |
221 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 221 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
222 }; | 222 }; |
223 | 223 |
224 } // namespace ui | 224 } // namespace ui |
225 | 225 |
226 // TODO(beng): Someday, maybe, get rid of this. | 226 // TODO(beng): Someday, maybe, get rid of this. |
227 using ui::ResourceBundle; | 227 using ui::ResourceBundle; |
228 | 228 |
229 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 229 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
OLD | NEW |