| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // The following holds true for the font sizes: | 62 // The following holds true for the font sizes: |
| 63 // Small <= Base <= Bold <= Medium <= MediumBold <= Large. | 63 // Small <= Base <= Bold <= Medium <= MediumBold <= Large. |
| 64 enum FontStyle { | 64 enum FontStyle { |
| 65 SmallFont, | 65 SmallFont, |
| 66 BaseFont, | 66 BaseFont, |
| 67 BoldFont, | 67 BoldFont, |
| 68 MediumFont, | 68 MediumFont, |
| 69 // NOTE: depending upon the locale, this may *not* result in a bold font. | 69 // NOTE: depending upon the locale, this may *not* result in a bold font. |
| 70 MediumBoldFont, | 70 MediumBoldFont, |
| 71 LargeFont, | 71 LargeFont, |
| 72 // NOTE: depending upon the locale, this may *not* result in a bold font. |
| 73 LargeBoldFont, |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 // Initialize the ResourceBundle for this process. Returns the language | 76 // Initialize the ResourceBundle for this process. Returns the language |
| 75 // selected. | 77 // selected. |
| 76 // NOTE: Mac ignores this and always loads up resources for the language | 78 // NOTE: Mac ignores this and always loads up resources for the language |
| 77 // defined by the Cocoa UI (ie-NSBundle does the langange work). | 79 // defined by the Cocoa UI (ie-NSBundle does the langange work). |
| 78 static std::string InitSharedInstance(const std::string& pref_locale); | 80 static std::string InitSharedInstance(const std::string& pref_locale); |
| 79 | 81 |
| 80 // Initialize the ResourceBundle using given data pack path for testing. | 82 // Initialize the ResourceBundle using given data pack path for testing. |
| 81 static void InitSharedInstanceForTest(const FilePath& path); | 83 static void InitSharedInstanceForTest(const FilePath& path); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 typedef std::map<int, gfx::Image*> ImageMap; | 276 typedef std::map<int, gfx::Image*> ImageMap; |
| 275 ImageMap images_; | 277 ImageMap images_; |
| 276 | 278 |
| 277 // The various fonts used. Cached to avoid repeated GDI creation/destruction. | 279 // The various fonts used. Cached to avoid repeated GDI creation/destruction. |
| 278 scoped_ptr<gfx::Font> base_font_; | 280 scoped_ptr<gfx::Font> base_font_; |
| 279 scoped_ptr<gfx::Font> bold_font_; | 281 scoped_ptr<gfx::Font> bold_font_; |
| 280 scoped_ptr<gfx::Font> small_font_; | 282 scoped_ptr<gfx::Font> small_font_; |
| 281 scoped_ptr<gfx::Font> medium_font_; | 283 scoped_ptr<gfx::Font> medium_font_; |
| 282 scoped_ptr<gfx::Font> medium_bold_font_; | 284 scoped_ptr<gfx::Font> medium_bold_font_; |
| 283 scoped_ptr<gfx::Font> large_font_; | 285 scoped_ptr<gfx::Font> large_font_; |
| 286 scoped_ptr<gfx::Font> large_bold_font_; |
| 284 scoped_ptr<gfx::Font> web_font_; | 287 scoped_ptr<gfx::Font> web_font_; |
| 285 | 288 |
| 286 static ResourceBundle* g_shared_instance_; | 289 static ResourceBundle* g_shared_instance_; |
| 287 | 290 |
| 288 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 291 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
| 289 }; | 292 }; |
| 290 | 293 |
| 291 } // namespace ui | 294 } // namespace ui |
| 292 | 295 |
| 293 // TODO(beng): Someday, maybe, get rid of this. | 296 // TODO(beng): Someday, maybe, get rid of this. |
| 294 using ui::ResourceBundle; | 297 using ui::ResourceBundle; |
| 295 | 298 |
| 296 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 299 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
| OLD | NEW |