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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // Returns false if the resource does not exist. | 303 // Returns false if the resource does not exist. |
304 // | 304 // |
305 // If the call succeeds, |fell_back_to_1x| indicates whether Chrome's custom | 305 // If the call succeeds, |fell_back_to_1x| indicates whether Chrome's custom |
306 // csCl PNG chunk is present (added by GRIT if it falls back to a 100% image). | 306 // csCl PNG chunk is present (added by GRIT if it falls back to a 100% image). |
307 bool LoadBitmap(const ResourceHandle& data_handle, | 307 bool LoadBitmap(const ResourceHandle& data_handle, |
308 int resource_id, | 308 int resource_id, |
309 SkBitmap* bitmap, | 309 SkBitmap* bitmap, |
310 bool* fell_back_to_1x) const; | 310 bool* fell_back_to_1x) const; |
311 | 311 |
312 // Fills the |bitmap| given the |resource_id| and |scale_factor|. | 312 // Fills the |bitmap| given the |resource_id| and |scale_factor|. |
313 // Returns false if the resource does not exist. | 313 // Returns false if the resource does not exist. This may fall back to |
| 314 // the data pack with SCALE_FACTOR_NONE, and when this happens, |
| 315 // |scale_factor| will be set to SCALE_FACTOR_100P. |
314 bool LoadBitmap(int resource_id, | 316 bool LoadBitmap(int resource_id, |
315 ScaleFactor scale_factor, | 317 ScaleFactor* scale_factor, |
316 SkBitmap* bitmap, | 318 SkBitmap* bitmap, |
317 bool* fell_back_to_1x) const; | 319 bool* fell_back_to_1x) const; |
318 | 320 |
319 // Returns an empty image for when a resource cannot be loaded. This is a | 321 // Returns an empty image for when a resource cannot be loaded. This is a |
320 // bright red bitmap. | 322 // bright red bitmap. |
321 gfx::Image& GetEmptyImage(); | 323 gfx::Image& GetEmptyImage(); |
322 | 324 |
323 const FilePath& GetOverriddenPakPath(); | 325 const FilePath& GetOverriddenPakPath(); |
324 | 326 |
325 // This pointer is guaranteed to outlive the ResourceBundle instance and may | 327 // This pointer is guaranteed to outlive the ResourceBundle instance and may |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 362 |
361 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 363 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
362 }; | 364 }; |
363 | 365 |
364 } // namespace ui | 366 } // namespace ui |
365 | 367 |
366 // TODO(beng): Someday, maybe, get rid of this. | 368 // TODO(beng): Someday, maybe, get rid of this. |
367 using ui::ResourceBundle; | 369 using ui::ResourceBundle; |
368 | 370 |
369 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 371 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
OLD | NEW |