| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // on another thread. | 147 // on another thread. |
| 148 std::string ReloadLocaleResources(const std::string& pref_locale); | 148 std::string ReloadLocaleResources(const std::string& pref_locale); |
| 149 | 149 |
| 150 // Gets the bitmap with the specified resource_id from the current module | 150 // Gets the bitmap with the specified resource_id from the current module |
| 151 // data. Returns a pointer to a shared instance of the SkBitmap. This shared | 151 // data. Returns a pointer to a shared instance of the SkBitmap. This shared |
| 152 // bitmap is owned by the resource bundle and should not be freed. | 152 // bitmap is owned by the resource bundle and should not be freed. |
| 153 // | 153 // |
| 154 // !! THIS IS DEPRECATED. PLEASE USE THE METHOD BELOW. !! | 154 // !! THIS IS DEPRECATED. PLEASE USE THE METHOD BELOW. !! |
| 155 SkBitmap* GetBitmapNamed(int resource_id); | 155 SkBitmap* GetBitmapNamed(int resource_id); |
| 156 | 156 |
| 157 // Gets image with the specified resource_id from the current module data. |
| 158 // Returns a pointer to a shared instance of gfx::ImageSkia. This shared |
| 159 // instance is owned by the resource bundle and should not be freed. |
| 160 // TODO(pkotwicz): Make method return const gfx::ImageSkia* |
| 161 // |
| 162 // NOTE: It is preferrable to use GetImageNamed such that code is more |
| 163 // portable. |
| 164 gfx::ImageSkia* GetImageSkiaNamed(int resource_id); |
| 165 |
| 157 // Gets an image resource from the current module data. This will load the | 166 // Gets an image resource from the current module data. This will load the |
| 158 // image in Skia format by default. The ResourceBundle owns this. | 167 // image in Skia format by default. The ResourceBundle owns this. |
| 159 gfx::Image& GetImageNamed(int resource_id); | 168 gfx::Image& GetImageNamed(int resource_id); |
| 160 | 169 |
| 161 // Similar to GetImageNamed, but rather than loading the image in Skia format, | 170 // Similar to GetImageNamed, but rather than loading the image in Skia format, |
| 162 // it will load in the native platform type. This can avoid conversion from | 171 // it will load in the native platform type. This can avoid conversion from |
| 163 // one image type to another. ResourceBundle owns the result. | 172 // one image type to another. ResourceBundle owns the result. |
| 164 // | 173 // |
| 165 // Note that if the same resource has already been loaded in GetImageNamed(), | 174 // Note that if the same resource has already been loaded in GetImageNamed(), |
| 166 // gfx::Image will perform a conversion, rather than using the native image | 175 // gfx::Image will perform a conversion, rather than using the native image |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 292 |
| 284 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 293 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
| 285 }; | 294 }; |
| 286 | 295 |
| 287 } // namespace ui | 296 } // namespace ui |
| 288 | 297 |
| 289 // TODO(beng): Someday, maybe, get rid of this. | 298 // TODO(beng): Someday, maybe, get rid of this. |
| 290 using ui::ResourceBundle; | 299 using ui::ResourceBundle; |
| 291 | 300 |
| 292 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 301 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
| OLD | NEW |