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_GFX_MAC_NSIMAGE_CACHE_H_ | 5 #ifndef UI_GFX_MAC_NSIMAGE_CACHE_H_ |
6 #define UI_GFX_MAC_NSIMAGE_CACHE_H_ | 6 #define UI_GFX_MAC_NSIMAGE_CACHE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/ui_api.h" | 9 #include "ui/base/ui_export.h" |
10 | 10 |
11 #ifdef __OBJC__ | 11 #ifdef __OBJC__ |
12 @class NSImage; | 12 @class NSImage; |
13 @class NSString; | 13 @class NSString; |
14 #else | 14 #else |
15 class NSImage; | 15 class NSImage; |
16 class NSString; | 16 class NSString; |
17 #endif | 17 #endif |
18 | 18 |
19 namespace gfx { | 19 namespace gfx { |
20 | 20 |
21 // Returns an autoreleased image from the main app bundle | 21 // Returns an autoreleased image from the main app bundle |
22 // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so | 22 // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so |
23 // future fetches are fast. | 23 // future fetches are fast. |
24 // NOTE: | 24 // NOTE: |
25 // - This should only be called on the main thread. | 25 // - This should only be called on the main thread. |
26 // - The caller should retain the image if they want to keep it around, as | 26 // - The caller should retain the image if they want to keep it around, as |
27 // the cache could have limit on size/lifetime, etc. | 27 // the cache could have limit on size/lifetime, etc. |
28 UI_API NSImage* GetCachedImageWithName(NSString* name); | 28 UI_EXPORT NSImage* GetCachedImageWithName(NSString* name); |
29 | 29 |
30 // Clears the image cache. | 30 // Clears the image cache. |
31 void ClearCachedImages(void); | 31 void ClearCachedImages(void); |
32 | 32 |
33 } // namespace gfx | 33 } // namespace gfx |
34 | 34 |
35 #endif // UI_GFX_MAC_NSIMAGE_CACHE_H_ | 35 #endif // UI_GFX_MAC_NSIMAGE_CACHE_H_ |
OLD | NEW |