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