Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: app/mac/nsimage_cache.h

Issue 5961007: Move nsimage_cache from base to app/mac. Use the app::mac namespace. Update c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 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 BASE_NSIMAGE_CACHE_MAC_H_ 5 #ifndef APP_MAC_NSIMAGE_CACHE_H_
6 #define BASE_NSIMAGE_CACHE_MAC_H_ 6 #define APP_MAC_NSIMAGE_CACHE_H_
7 #pragma once 7 #pragma once
8 8
9 #ifdef __OBJC__ 9 #ifdef __OBJC__
10 @class NSImage; 10 @class NSImage;
11 @class NSString; 11 @class NSString;
12 #else 12 #else
13 class NSImage; 13 class NSImage;
14 class NSString; 14 class NSString;
15 #endif 15 #endif
16 16
17 namespace nsimage_cache { 17 namespace app {
18 namespace mac {
18 19
19 // Returns an autoreleased image from the main app bundle 20 // Returns an autoreleased image from the main app bundle
20 // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so 21 // (mac_util::MainAppBundle()) with the given name, and keeps it in memory so
21 // future fetches are fast. 22 // future fetches are fast.
22 // NOTE: 23 // NOTE:
23 // - This should only be called on the main thread. 24 // - This should only be called on the main thread.
24 // - The caller should retain the image if they want to keep it around, as 25 // - The caller should retain the image if they want to keep it around, as
25 // the cache could have limit on size/lifetime, etc. 26 // the cache could have limit on size/lifetime, etc.
26 NSImage* ImageNamed(NSString* name); 27 NSImage* GetCachedImageWithName(NSString* name);
Avi (use Gerrit) 2010/12/22 19:06:38 Why the name change? This does imply a bit that on
brettw 2010/12/22 19:12:05 app::mac::ImageNamed is too vague (more stuff will
27 28
28 // Clears the cache. 29 // Clears the image cache.
29 void Clear(void); 30 void ClearCachedImages(void);
30 31
31 } // namespace nsimage_cache 32 } // namespace mac
33 } // namespace app
32 34
33 #endif // BASE_NSIMAGE_CACHE_MAC_H_ 35 #endif // APP_MAC_NSIMAGE_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698