OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ |
6 #define CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class ImageSkia; | 13 class ImageSkia; |
14 } | 14 } |
15 | 15 |
16 // There are several dialogs that display tabular data with one SkBitmap | 16 // There are several dialogs that display tabular data with one SkBitmap |
17 // per row. This class converts these SkBitmaps to NSImages on demand, and | 17 // per row. This class converts these SkBitmaps to NSImages on demand, and |
18 // caches the results. | 18 // caches the results. |
19 class TableRowNSImageCache { | 19 class TableRowNSImageCache { |
20 public: | 20 public: |
(...skipping 22 matching lines...) Expand all Loading... |
43 void OnItemsChanged(int start, int length); | 43 void OnItemsChanged(int start, int length); |
44 void OnItemsAdded(int start, int length); | 44 void OnItemsAdded(int start, int length); |
45 void OnItemsRemoved(int start, int length); | 45 void OnItemsRemoved(int start, int length); |
46 | 46 |
47 private: | 47 private: |
48 // The table model we query for row count and icons. | 48 // The table model we query for row count and icons. |
49 Table* model_; // weak | 49 Table* model_; // weak |
50 | 50 |
51 // Stores strong NSImage refs for icons. If an entry is NULL, it will be | 51 // Stores strong NSImage refs for icons. If an entry is NULL, it will be |
52 // created in GetImageForRow(). | 52 // created in GetImageForRow(). |
53 scoped_nsobject<NSPointerArray> icon_images_; | 53 base::scoped_nsobject<NSPointerArray> icon_images_; |
54 }; | 54 }; |
55 | 55 |
56 #endif // CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ | 56 #endif // CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_ |
OLD | NEW |