summaryrefslogtreecommitdiffstats
path: root/base/nsimage_cache_mac.h
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-05 19:07:34 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-05 19:07:34 +0000
commit3075a7fdc642d705bec27b857d284b5b12c6dff0 (patch)
treedecd2068a70a330e44dae9b7a5f4e26f73ea33cc /base/nsimage_cache_mac.h
parenta3416f9ba02ce9ca1e52b033fafabeffab50dceb (diff)
downloadchromium_src-3075a7fdc642d705bec27b857d284b5b12c6dff0.zip
chromium_src-3075a7fdc642d705bec27b857d284b5b12c6dff0.tar.gz
chromium_src-3075a7fdc642d705bec27b857d284b5b12c6dff0.tar.bz2
Move nsimage_cache into base so that it can be accessed from outside of chrome.
This is in support of the next round of rebundling. TEST=does it still build, do the unit tests still pass, does it still work? BUG=14610 Review URL: http://codereview.chromium.org/243100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/nsimage_cache_mac.h')
-rw-r--r--base/nsimage_cache_mac.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/base/nsimage_cache_mac.h b/base/nsimage_cache_mac.h
new file mode 100644
index 0000000..ffa8dbb
--- /dev/null
+++ b/base/nsimage_cache_mac.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_NSIMAGE_CACHE_MAC_H_
+#define BASE_NSIMAGE_CACHE_MAC_H_
+
+#ifdef __OBJC__
+@class NSImage;
+@class NSString;
+#else
+class NSImage;
+class NSString;
+#endif
+
+namespace nsimage_cache {
+
+// Returns an autoreleased image from the main app bundle
+// (mac_util::MainAppBundle()) with the given name, and keeps it in memory so
+// future fetches are fast.
+// NOTE:
+// - This should only be called on the main thread.
+// - The caller should retain the image if they want to keep it around, as
+// the cache could have limit on size/lifetime, etc.
+NSImage* ImageNamed(NSString* name);
+
+// Clears the cache.
+void Clear(void);
+
+} // namespace nsimage_cache
+
+#endif // BASE_NSIMAGE_CACHE_MAC_H_