| 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // resource pack is loaded. | 275 // resource pack is loaded. |
| 276 void LoadTestResources(const FilePath& path, const FilePath& locale_path); | 276 void LoadTestResources(const FilePath& path, const FilePath& locale_path); |
| 277 | 277 |
| 278 // Unload the locale specific strings and prepares to load new ones. See | 278 // Unload the locale specific strings and prepares to load new ones. See |
| 279 // comments for ReloadLocaleResources(). | 279 // comments for ReloadLocaleResources(). |
| 280 void UnloadLocaleResources(); | 280 void UnloadLocaleResources(); |
| 281 | 281 |
| 282 // Initialize all the gfx::Font members if they haven't yet been initialized. | 282 // Initialize all the gfx::Font members if they haven't yet been initialized. |
| 283 void LoadFontsIfNecessary(); | 283 void LoadFontsIfNecessary(); |
| 284 | 284 |
| 285 // Creates and returns a new SkBitmap given the data file to look in and the | 285 // Fills the |bitmap| given the data file to look in and the |resource_id|. |
| 286 // |resource_id|. It's up to the caller to free the returned bitmap when | 286 // Returns false if the resource does not exist. |
| 287 // done. | 287 // |
| 288 SkBitmap* LoadBitmap(const ResourceHandle& dll_inst, int resource_id) const; | 288 // If |percent| is not NULL, it is filled with the value from Chrome's custom |
| 289 // csCl PNG chunk, if present, or -1 otherwise. |
| 290 bool LoadBitmap(const ResourceHandle& dll_inst, |
| 291 int resource_id, |
| 292 SkBitmap* bitmap, |
| 293 int* percent) const; |
| 289 | 294 |
| 290 // Creates and returns a new SkBitmap for |resource_id| and |scale_factor|. | 295 // Fills the |bitmap| given the |resource_id| and |scale_factor|. |
| 291 // Returns NULL if the resource does not exist. | 296 // Returns false if the resource does not exist. |
| 292 SkBitmap* LoadBitmap(int resource_id, ScaleFactor scale_factor) const; | 297 bool LoadBitmap(int resource_id, |
| 298 ScaleFactor scale_factor, |
| 299 SkBitmap* bitmap, |
| 300 int* percent) const; |
| 293 | 301 |
| 294 // Returns an empty image for when a resource cannot be loaded. This is a | 302 // Returns an empty image for when a resource cannot be loaded. This is a |
| 295 // bright red bitmap. | 303 // bright red bitmap. |
| 296 gfx::Image& GetEmptyImage(); | 304 gfx::Image& GetEmptyImage(); |
| 297 | 305 |
| 298 const FilePath& GetOverriddenPakPath(); | 306 const FilePath& GetOverriddenPakPath(); |
| 299 | 307 |
| 300 // This pointer is guaranteed to outlive the ResourceBundle instance and may | 308 // This pointer is guaranteed to outlive the ResourceBundle instance and may |
| 301 // be NULL. | 309 // be NULL. |
| 302 Delegate* delegate_; | 310 Delegate* delegate_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 332 | 340 |
| 333 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 341 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
| 334 }; | 342 }; |
| 335 | 343 |
| 336 } // namespace ui | 344 } // namespace ui |
| 337 | 345 |
| 338 // TODO(beng): Someday, maybe, get rid of this. | 346 // TODO(beng): Someday, maybe, get rid of this. |
| 339 using ui::ResourceBundle; | 347 using ui::ResourceBundle; |
| 340 | 348 |
| 341 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 349 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
| OLD | NEW |