| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_COCOA_DOWNLOAD_ITEM_MAC_H_ | 5 #ifndef CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_ |
| 6 #define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_ | 6 #define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 // DownloadItemMac takes ownership of |download_model|. | 25 // DownloadItemMac takes ownership of |download_model|. |
| 26 DownloadItemMac(BaseDownloadItemModel* download_model, | 26 DownloadItemMac(BaseDownloadItemModel* download_model, |
| 27 DownloadItemController* controller); | 27 DownloadItemController* controller); |
| 28 | 28 |
| 29 // Destructor. | 29 // Destructor. |
| 30 ~DownloadItemMac(); | 30 ~DownloadItemMac(); |
| 31 | 31 |
| 32 // DownloadItem::Observer implementation | 32 // DownloadItem::Observer implementation |
| 33 virtual void OnDownloadUpdated(DownloadItem* download); | 33 virtual void OnDownloadUpdated(DownloadItem* download); |
| 34 virtual void OnDownloadFileCompleted(DownloadItem* download) { } |
| 34 virtual void OnDownloadOpened(DownloadItem* download) { } | 35 virtual void OnDownloadOpened(DownloadItem* download) { } |
| 35 | 36 |
| 36 BaseDownloadItemModel* download_model() { return download_model_.get(); } | 37 BaseDownloadItemModel* download_model() { return download_model_.get(); } |
| 37 | 38 |
| 38 // Asynchronous icon loading support. | 39 // Asynchronous icon loading support. |
| 39 void LoadIcon(); | 40 void LoadIcon(); |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 // Callback for asynchronous icon loading. | 43 // Callback for asynchronous icon loading. |
| 43 void OnExtractIconComplete(IconManager::Handle handle, SkBitmap* icon_bitmap); | 44 void OnExtractIconComplete(IconManager::Handle handle, SkBitmap* icon_bitmap); |
| 44 | 45 |
| 45 // The download item model we represent. | 46 // The download item model we represent. |
| 46 scoped_ptr<BaseDownloadItemModel> download_model_; | 47 scoped_ptr<BaseDownloadItemModel> download_model_; |
| 47 | 48 |
| 48 // The objective-c controller object. | 49 // The objective-c controller object. |
| 49 DownloadItemController* item_controller_; // weak, owns us. | 50 DownloadItemController* item_controller_; // weak, owns us. |
| 50 | 51 |
| 51 // For canceling an in progress icon request. | 52 // For canceling an in progress icon request. |
| 52 CancelableRequestConsumerT<int, 0> icon_consumer_; | 53 CancelableRequestConsumerT<int, 0> icon_consumer_; |
| 53 | 54 |
| 54 // Stores the last known name where the file will be saved. | 55 // Stores the last known name where the file will be saved. |
| 55 FilePath lastFilePath_; | 56 FilePath lastFilePath_; |
| 56 | 57 |
| 57 DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); | 58 DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 #endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_ | 61 #endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_ |
| OLD | NEW |