WebKit Roll 88523:88542.
[chromium-blink-merge.git] / app / mac / nsimage_cache.h
blobed1de06bd4c261c247378608de0b76c16f7f839b
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef APP_MAC_NSIMAGE_CACHE_H_
6 #define APP_MAC_NSIMAGE_CACHE_H_
7 #pragma once
9 #ifdef __OBJC__
10 @class NSImage;
11 @class NSString;
12 #else
13 class NSImage;
14 class NSString;
15 #endif
17 namespace app {
18 namespace mac {
20 // Returns an autoreleased image from the main app bundle
21 // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so
22 // future fetches are fast.
23 // NOTE:
24 // - This should only be called on the main thread.
25 // - The caller should retain the image if they want to keep it around, as
26 // the cache could have limit on size/lifetime, etc.
27 NSImage* GetCachedImageWithName(NSString* name);
29 // Clears the image cache.
30 void ClearCachedImages(void);
32 } // namespace mac
33 } // namespace app
35 #endif // APP_MAC_NSIMAGE_CACHE_H_