| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 | 13 |
| 13 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/files/memory_mapped_file.h" | 16 #include "base/files/memory_mapped_file.h" |
| 16 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 18 #include "base/macros.h" |
| 18 #include "base/memory/scoped_ptr.h" | |
| 19 #include "base/memory/scoped_vector.h" | 19 #include "base/memory/scoped_vector.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "base/strings/string_piece.h" | 21 #include "base/strings/string_piece.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "ui/base/layout.h" | 23 #include "ui/base/layout.h" |
| 24 #include "ui/base/ui_base_export.h" | 24 #include "ui/base/ui_base_export.h" |
| 25 #include "ui/gfx/font_list.h" | 25 #include "ui/gfx/font_list.h" |
| 26 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
| 28 | 28 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // bright red bitmap. | 403 // bright red bitmap. |
| 404 gfx::Image& GetEmptyImage(); | 404 gfx::Image& GetEmptyImage(); |
| 405 | 405 |
| 406 const base::FilePath& GetOverriddenPakPath(); | 406 const base::FilePath& GetOverriddenPakPath(); |
| 407 | 407 |
| 408 // This pointer is guaranteed to outlive the ResourceBundle instance and may | 408 // This pointer is guaranteed to outlive the ResourceBundle instance and may |
| 409 // be NULL. | 409 // be NULL. |
| 410 Delegate* delegate_; | 410 Delegate* delegate_; |
| 411 | 411 |
| 412 // Protects |images_| and font-related members. | 412 // Protects |images_| and font-related members. |
| 413 scoped_ptr<base::Lock> images_and_fonts_lock_; | 413 std::unique_ptr<base::Lock> images_and_fonts_lock_; |
| 414 | 414 |
| 415 // Protects |locale_resources_data_|. | 415 // Protects |locale_resources_data_|. |
| 416 scoped_ptr<base::Lock> locale_resources_data_lock_; | 416 std::unique_ptr<base::Lock> locale_resources_data_lock_; |
| 417 | 417 |
| 418 // Handles for data sources. | 418 // Handles for data sources. |
| 419 scoped_ptr<ResourceHandle> locale_resources_data_; | 419 std::unique_ptr<ResourceHandle> locale_resources_data_; |
| 420 ScopedVector<ResourceHandle> data_packs_; | 420 ScopedVector<ResourceHandle> data_packs_; |
| 421 | 421 |
| 422 // The maximum scale factor currently loaded. | 422 // The maximum scale factor currently loaded. |
| 423 ScaleFactor max_scale_factor_; | 423 ScaleFactor max_scale_factor_; |
| 424 | 424 |
| 425 // Cached images. The ResourceBundle caches all retrieved images and keeps | 425 // Cached images. The ResourceBundle caches all retrieved images and keeps |
| 426 // ownership of the pointers. | 426 // ownership of the pointers. |
| 427 typedef std::map<int, gfx::Image> ImageMap; | 427 typedef std::map<int, gfx::Image> ImageMap; |
| 428 ImageMap images_; | 428 ImageMap images_; |
| 429 | 429 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 441 | 441 |
| 442 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 442 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
| 443 }; | 443 }; |
| 444 | 444 |
| 445 } // namespace ui | 445 } // namespace ui |
| 446 | 446 |
| 447 // TODO(beng): Someday, maybe, get rid of this. | 447 // TODO(beng): Someday, maybe, get rid of this. |
| 448 using ui::ResourceBundle; | 448 using ui::ResourceBundle; |
| 449 | 449 |
| 450 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 450 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
| OLD | NEW |