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