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 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 #endif | 27 #endif |
28 #if defined(USE_X11) | 28 #if defined(USE_X11) |
29 typedef struct _GdkPixbuf GdkPixbuf; | 29 typedef struct _GdkPixbuf GdkPixbuf; |
30 #endif | 30 #endif |
31 namespace gfx { | 31 namespace gfx { |
32 class Font; | 32 class Font; |
33 } | 33 } |
34 class SkBitmap; | 34 class SkBitmap; |
35 typedef uint32 SkColor; | 35 typedef uint32 SkColor; |
| 36 namespace base { |
36 class StringPiece; | 37 class StringPiece; |
| 38 } |
37 | 39 |
38 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
39 #ifdef __OBJC__ | 41 #ifdef __OBJC__ |
40 @class NSImage; | 42 @class NSImage; |
41 #else | 43 #else |
42 class NSImage; | 44 class NSImage; |
43 #endif // __OBJC__ | 45 #endif // __OBJC__ |
44 #endif // defined(OS_MACOSX) | 46 #endif // defined(OS_MACOSX) |
45 | 47 |
46 // ResourceBundle is a central facility to load images and other resources, | 48 // ResourceBundle is a central facility to load images and other resources, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 std::vector<unsigned char>* bytes); | 100 std::vector<unsigned char>* bytes); |
99 | 101 |
100 // Return the contents of a file in a string given the resource id. | 102 // Return the contents of a file in a string given the resource id. |
101 // This will copy the data from the resource and return it as a string. | 103 // This will copy the data from the resource and return it as a string. |
102 // TODO(port): deprecate this and replace with GetRawDataResource to avoid | 104 // TODO(port): deprecate this and replace with GetRawDataResource to avoid |
103 // needless copying. | 105 // needless copying. |
104 std::string GetDataResource(int resource_id); | 106 std::string GetDataResource(int resource_id); |
105 | 107 |
106 // Like GetDataResource(), but avoids copying the resource. Instead, it | 108 // Like GetDataResource(), but avoids copying the resource. Instead, it |
107 // returns a StringPiece which points into the actual resource in the image. | 109 // returns a StringPiece which points into the actual resource in the image. |
108 StringPiece GetRawDataResource(int resource_id); | 110 base::StringPiece GetRawDataResource(int resource_id); |
109 | 111 |
110 // Get a localized string given a message id. Returns an empty | 112 // Get a localized string given a message id. Returns an empty |
111 // string if the message_id is not found. | 113 // string if the message_id is not found. |
112 string16 GetLocalizedString(int message_id); | 114 string16 GetLocalizedString(int message_id); |
113 | 115 |
114 // Returns the font for the specified style. | 116 // Returns the font for the specified style. |
115 gfx::Font GetFont(FontStyle style); | 117 gfx::Font GetFont(FontStyle style); |
116 | 118 |
117 #if defined(OS_WIN) | 119 #if defined(OS_WIN) |
118 // Loads and returns an icon from the theme dll. | 120 // Loads and returns an icon from the theme dll. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 scoped_ptr<gfx::Font> medium_bold_font_; | 222 scoped_ptr<gfx::Font> medium_bold_font_; |
221 scoped_ptr<gfx::Font> large_font_; | 223 scoped_ptr<gfx::Font> large_font_; |
222 scoped_ptr<gfx::Font> web_font_; | 224 scoped_ptr<gfx::Font> web_font_; |
223 | 225 |
224 static ResourceBundle* g_shared_instance_; | 226 static ResourceBundle* g_shared_instance_; |
225 | 227 |
226 DISALLOW_EVIL_CONSTRUCTORS(ResourceBundle); | 228 DISALLOW_EVIL_CONSTRUCTORS(ResourceBundle); |
227 }; | 229 }; |
228 | 230 |
229 #endif // APP_RESOURCE_BUNDLE_H_ | 231 #endif // APP_RESOURCE_BUNDLE_H_ |
OLD | NEW |