OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Registers additional data pack files with the global ResourceBundle. When | 98 // Registers additional data pack files with the global ResourceBundle. When |
99 // looking for a DataResource, we will search these files after searching the | 99 // looking for a DataResource, we will search these files after searching the |
100 // main module. This method is not thread safe! You should call it | 100 // main module. This method is not thread safe! You should call it |
101 // immediately after calling InitSharedInstance. | 101 // immediately after calling InitSharedInstance. |
102 static void AddDataPackToSharedInstance(const FilePath& path); | 102 static void AddDataPackToSharedInstance(const FilePath& path); |
103 | 103 |
104 // Delete the ResourceBundle for this process if it exists. | 104 // Delete the ResourceBundle for this process if it exists. |
105 static void CleanupSharedInstance(); | 105 static void CleanupSharedInstance(); |
106 | 106 |
| 107 // Returns true after the global resource loader instance has been created. |
| 108 static bool HasSharedInstance(); |
| 109 |
107 // Return the global resource loader instance. | 110 // Return the global resource loader instance. |
108 static ResourceBundle& GetSharedInstance(); | 111 static ResourceBundle& GetSharedInstance(); |
109 | 112 |
110 // Check if the .pak for the given locale exists. | 113 // Check if the .pak for the given locale exists. |
111 static bool LocaleDataPakExists(const std::string& locale); | 114 static bool LocaleDataPakExists(const std::string& locale); |
112 | 115 |
113 // Gets the bitmap with the specified resource_id from the current module | 116 // Gets the bitmap with the specified resource_id from the current module |
114 // data. Returns a pointer to a shared instance of the SkBitmap. This shared | 117 // data. Returns a pointer to a shared instance of the SkBitmap. This shared |
115 // bitmap is owned by the resource bundle and should not be freed. | 118 // bitmap is owned by the resource bundle and should not be freed. |
116 // | 119 // |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 313 |
311 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 314 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
312 }; | 315 }; |
313 | 316 |
314 } // namespace ui | 317 } // namespace ui |
315 | 318 |
316 // TODO(beng): Someday, maybe, get rid of this. | 319 // TODO(beng): Someday, maybe, get rid of this. |
317 using ui::ResourceBundle; | 320 using ui::ResourceBundle; |
318 | 321 |
319 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 322 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
OLD | NEW |