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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
12 #include <windows.h> | 12 #include <windows.h> |
13 #endif | 13 #endif |
14 | 14 |
15 #include <map> | 15 #include <map> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/file_path.h" | 20 #include "base/file_path.h" |
21 #include "base/gtest_prod_util.h" | 21 #include "base/gtest_prod_util.h" |
22 #include "base/memory/ref_counted_memory.h" | 22 #include "base/memory/ref_counted_memory.h" |
23 #include "base/memory/scoped_ptr.h" | 23 #include "base/memory/scoped_ptr.h" |
24 #include "base/string16.h" | 24 #include "base/string16.h" |
25 #include "base/string_piece.h" | 25 #include "base/string_piece.h" |
26 #include "ui/base/ui_export.h" | 26 #include "ui/base/ui_export.h" |
27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
28 | 28 |
29 class SkBitmap; | 29 class SkBitmap; |
30 // Don't use uint32 or uint32_t here because Eclipse's indexer gets confused. | |
31 // This can be removed when the static colors are moved to ThemeProvider. | |
32 typedef unsigned int SkColor; | |
33 | 30 |
34 namespace base { | 31 namespace base { |
35 class Lock; | 32 class Lock; |
36 } | 33 } |
37 | 34 |
38 namespace gfx { | 35 namespace gfx { |
39 class Font; | 36 class Font; |
40 class Image; | 37 class Image; |
41 } | 38 } |
42 | 39 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Same as above, but returns a gfx::Image wrapping the GdkPixbuf. | 181 // Same as above, but returns a gfx::Image wrapping the GdkPixbuf. |
185 gfx::Image& GetRTLEnabledImageNamed(int resource_id); | 182 gfx::Image& GetRTLEnabledImageNamed(int resource_id); |
186 | 183 |
187 private: | 184 private: |
188 // Shared implementation for the above two functions. | 185 // Shared implementation for the above two functions. |
189 gfx::Image* GetPixbufImpl(int resource_id, bool rtl_enabled); | 186 gfx::Image* GetPixbufImpl(int resource_id, bool rtl_enabled); |
190 | 187 |
191 public: | 188 public: |
192 #endif | 189 #endif |
193 | 190 |
194 // TODO(beng): These browser-specific concepts should move to ThemeProvider. | |
195 static const SkColor toolbar_color; | |
196 | |
197 private: | 191 private: |
198 FRIEND_TEST_ALL_PREFIXES(ResourceBundle, LoadDataResourceBytes); | 192 FRIEND_TEST_ALL_PREFIXES(ResourceBundle, LoadDataResourceBytes); |
199 | 193 |
200 // Helper class for managing data packs. | 194 // Helper class for managing data packs. |
201 class LoadedDataPack { | 195 class LoadedDataPack { |
202 public: | 196 public: |
203 explicit LoadedDataPack(const FilePath& path); | 197 explicit LoadedDataPack(const FilePath& path); |
204 ~LoadedDataPack(); | 198 ~LoadedDataPack(); |
205 bool GetStringPiece(int resource_id, base::StringPiece* data) const; | 199 bool GetStringPiece(int resource_id, base::StringPiece* data) const; |
206 RefCountedStaticMemory* GetStaticMemory(int resource_id) const; | 200 RefCountedStaticMemory* GetStaticMemory(int resource_id) const; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 307 |
314 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 308 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
315 }; | 309 }; |
316 | 310 |
317 } // namespace ui | 311 } // namespace ui |
318 | 312 |
319 // TODO(beng): Someday, maybe, get rid of this. | 313 // TODO(beng): Someday, maybe, get rid of this. |
320 using ui::ResourceBundle; | 314 using ui::ResourceBundle; |
321 | 315 |
322 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 316 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
OLD | NEW |