| 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_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_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/memory/scoped_nsobject.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // DownloadItemMac takes ownership of |download_model|. | 30 // DownloadItemMac takes ownership of |download_model|. |
| 31 DownloadItemMac(BaseDownloadItemModel* download_model, | 31 DownloadItemMac(BaseDownloadItemModel* download_model, |
| 32 DownloadItemController* controller); | 32 DownloadItemController* controller); |
| 33 | 33 |
| 34 // Destructor. | 34 // Destructor. |
| 35 virtual ~DownloadItemMac(); | 35 virtual ~DownloadItemMac(); |
| 36 | 36 |
| 37 // content::DownloadItem::Observer implementation | 37 // content::DownloadItem::Observer implementation |
| 38 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 38 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 39 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 39 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; |
| 40 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 40 | 41 |
| 41 BaseDownloadItemModel* download_model() { return download_model_.get(); } | 42 BaseDownloadItemModel* download_model() { return download_model_.get(); } |
| 42 | 43 |
| 43 // Asynchronous icon loading support. | 44 // Asynchronous icon loading support. |
| 44 void LoadIcon(); | 45 void LoadIcon(); |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 // Callback for asynchronous icon loading. | 48 // Callback for asynchronous icon loading. |
| 48 void OnExtractIconComplete(IconManager::Handle handle, | 49 void OnExtractIconComplete(IconManager::Handle handle, |
| 49 gfx::Image* icon_bitmap); | 50 gfx::Image* icon_bitmap); |
| 50 | 51 |
| 51 // The download item model we represent. | 52 // The download item model we represent. |
| 52 scoped_ptr<BaseDownloadItemModel> download_model_; | 53 scoped_ptr<BaseDownloadItemModel> download_model_; |
| 53 | 54 |
| 54 // The objective-c controller object. | 55 // The objective-c controller object. |
| 55 DownloadItemController* item_controller_; // weak, owns us. | 56 DownloadItemController* item_controller_; // weak, owns us. |
| 56 | 57 |
| 57 // For canceling an in progress icon request. | 58 // For canceling an in progress icon request. |
| 58 CancelableRequestConsumerT<int, 0> icon_consumer_; | 59 CancelableRequestConsumerT<int, 0> icon_consumer_; |
| 59 | 60 |
| 60 // Stores the last known path where the file will be saved. | 61 // Stores the last known path where the file will be saved. |
| 61 FilePath lastFilePath_; | 62 FilePath lastFilePath_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); | 64 DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ | 67 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ |
| OLD | NEW |