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

Unified Diff: chrome/browser/ui/cocoa/table_row_nsimage_cache.h

Issue 2187993002: Remove the TableRowNSImageCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/table_row_nsimage_cache.mm » ('j') | chrome/chrome_browser_ui.gypi » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/table_row_nsimage_cache.h
diff --git a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
deleted file mode 100644
index 4932aa2f558ef4fd8cfd15a67d377c50ddb58d78..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2012 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 CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_
-#define CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_
-
-#import <Cocoa/Cocoa.h>
-
-#include "base/mac/scoped_nsobject.h"
-
-namespace gfx {
-class ImageSkia;
-}
-
-// There are several dialogs that display tabular data with one SkBitmap
-// per row. This class converts these SkBitmaps to NSImages on demand, and
-// caches the results.
-class TableRowNSImageCache {
- public:
- // Interface this cache expects for its table model.
- class Table {
- public:
- // Returns the number of rows in the table.
- virtual int RowCount() const = 0;
-
- // Returns the icon of the |row|th row.
- virtual gfx::ImageSkia GetIcon(int row) const = 0;
-
- protected:
- virtual ~Table() {}
- };
-
- // |model| must outlive the cache.
- explicit TableRowNSImageCache(Table* model);
- ~TableRowNSImageCache();
-
- // Lazily converts the image at the given row and caches it in |icon_images_|.
- NSImage* GetImageForRow(int row);
-
- // Call these functions every time the table changes, to update the cache.
- void OnModelChanged();
- void OnItemsChanged(int start, int length);
- void OnItemsAdded(int start, int length);
- void OnItemsRemoved(int start, int length);
-
- private:
- // The table model we query for row count and icons.
- Table* model_; // weak
-
- // Stores strong NSImage refs for icons. If an entry is NULL, it will be
- // created in GetImageForRow().
- base::scoped_nsobject<NSPointerArray> icon_images_;
-};
-
-#endif // CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/table_row_nsimage_cache.mm » ('j') | chrome/chrome_browser_ui.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698