1 // Copyright (c) 2009 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. 4 5 #ifndef BASE_NSIMAGE_CACHE_MAC_H_ 6 #define BASE_NSIMAGE_CACHE_MAC_H_ 7 8 #ifdef __OBJC__ 9 @class NSImage; 10 @class NSString; 11 #else 12 class NSImage; 13 class NSString; 14 #endif 15 16 namespace nsimage_cache { 17 18 // Returns an autoreleased image from the main app bundle 19 // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so 20 // future fetches are fast. 21 // NOTE: 22 // - This should only be called on the main thread. 23 // - The caller should retain the image if they want to keep it around, as 24 // the cache could have limit on size/lifetime, etc. 25 NSImage* ImageNamed(NSString* name); 26 27 // Clears the cache. 28 void Clear(void); 29 30 } // namespace nsimage_cache 31 32 #endif // BASE_NSIMAGE_CACHE_MAC_H_ 33