OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 APP_RESOURCE_BUNDLE_H_ | 5 #ifndef APP_RESOURCE_BUNDLE_H_ |
6 #define APP_RESOURCE_BUNDLE_H_ | 6 #define APP_RESOURCE_BUNDLE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #endif // __OBJC__ | 46 #endif // __OBJC__ |
47 #endif // defined(OS_MACOSX) | 47 #endif // defined(OS_MACOSX) |
48 | 48 |
49 // ResourceBundle is a central facility to load images and other resources, | 49 // ResourceBundle is a central facility to load images and other resources, |
50 // such as theme graphics. | 50 // such as theme graphics. |
51 // Every resource is loaded only once. | 51 // Every resource is loaded only once. |
52 class ResourceBundle { | 52 class ResourceBundle { |
53 public: | 53 public: |
54 // An enumeration of the various font styles used throughout Chrome. | 54 // An enumeration of the various font styles used throughout Chrome. |
55 // The following holds true for the font sizes: | 55 // The following holds true for the font sizes: |
56 // Small <= Base <= Medium <= MediumBold <= Large. | 56 // Small <= Base <= Bold <= Medium <= MediumBold <= Large. |
57 enum FontStyle { | 57 enum FontStyle { |
58 SmallFont, | 58 SmallFont, |
59 BaseFont, | 59 BaseFont, |
| 60 BoldFont, |
60 MediumFont, | 61 MediumFont, |
61 // NOTE: depending upon the locale, this may *not* result in a bold font. | 62 // NOTE: depending upon the locale, this may *not* result in a bold font. |
62 MediumBoldFont, | 63 MediumBoldFont, |
63 LargeFont, | 64 LargeFont, |
64 }; | 65 }; |
65 | 66 |
66 // Initialize the ResourceBundle for this process. Returns the language | 67 // Initialize the ResourceBundle for this process. Returns the language |
67 // selected. | 68 // selected. |
68 // NOTE: Mac ignores this and always loads up resources for the language | 69 // NOTE: Mac ignores this and always loads up resources for the language |
69 // defined by the Cocoa UI (ie-NSBundle does the langange work). | 70 // defined by the Cocoa UI (ie-NSBundle does the langange work). |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // ownership of the pointers. | 213 // ownership of the pointers. |
213 typedef std::map<int, SkBitmap*> SkImageMap; | 214 typedef std::map<int, SkBitmap*> SkImageMap; |
214 SkImageMap skia_images_; | 215 SkImageMap skia_images_; |
215 #if defined(USE_X11) | 216 #if defined(USE_X11) |
216 typedef std::map<int, GdkPixbuf*> GdkPixbufMap; | 217 typedef std::map<int, GdkPixbuf*> GdkPixbufMap; |
217 GdkPixbufMap gdk_pixbufs_; | 218 GdkPixbufMap gdk_pixbufs_; |
218 #endif | 219 #endif |
219 | 220 |
220 // The various fonts used. Cached to avoid repeated GDI creation/destruction. | 221 // The various fonts used. Cached to avoid repeated GDI creation/destruction. |
221 scoped_ptr<gfx::Font> base_font_; | 222 scoped_ptr<gfx::Font> base_font_; |
| 223 scoped_ptr<gfx::Font> bold_font_; |
222 scoped_ptr<gfx::Font> small_font_; | 224 scoped_ptr<gfx::Font> small_font_; |
223 scoped_ptr<gfx::Font> medium_font_; | 225 scoped_ptr<gfx::Font> medium_font_; |
224 scoped_ptr<gfx::Font> medium_bold_font_; | 226 scoped_ptr<gfx::Font> medium_bold_font_; |
225 scoped_ptr<gfx::Font> large_font_; | 227 scoped_ptr<gfx::Font> large_font_; |
226 scoped_ptr<gfx::Font> web_font_; | 228 scoped_ptr<gfx::Font> web_font_; |
227 | 229 |
228 static ResourceBundle* g_shared_instance_; | 230 static ResourceBundle* g_shared_instance_; |
229 | 231 |
230 DISALLOW_EVIL_CONSTRUCTORS(ResourceBundle); | 232 DISALLOW_EVIL_CONSTRUCTORS(ResourceBundle); |
231 }; | 233 }; |
232 | 234 |
233 #endif // APP_RESOURCE_BUNDLE_H_ | 235 #endif // APP_RESOURCE_BUNDLE_H_ |
OLD | NEW |