| 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/task/cancelable_task_tracker.h" | 10 #include "base/task/cancelable_task_tracker.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 DownloadItemMac(content::DownloadItem* download, | 28 DownloadItemMac(content::DownloadItem* download, |
| 29 DownloadItemController* controller); | 29 DownloadItemController* controller); |
| 30 | 30 |
| 31 // Destructor. | 31 // Destructor. |
| 32 virtual ~DownloadItemMac(); | 32 virtual ~DownloadItemMac(); |
| 33 | 33 |
| 34 // content::DownloadItem::Observer implementation | 34 // content::DownloadItem::Observer implementation |
| 35 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 35 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 36 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 36 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; |
| 37 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; | 37 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 38 virtual void OnDownloadItemShown(content::DownloadItem* download) OVERRIDE; |
| 38 | 39 |
| 39 DownloadItemModel* download_model() { return &download_model_; } | 40 DownloadItemModel* download_model() { return &download_model_; } |
| 40 | 41 |
| 41 // Asynchronous icon loading support. | 42 // Asynchronous icon loading support. |
| 42 void LoadIcon(); | 43 void LoadIcon(); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 // Callback for asynchronous icon loading. | 46 // Callback for asynchronous icon loading. |
| 46 void OnExtractIconComplete(gfx::Image* icon_bitmap); | 47 void OnExtractIconComplete(gfx::Image* icon_bitmap); |
| 47 | 48 |
| 48 // The download item model we represent. | 49 // The download item model we represent. |
| 49 DownloadItemModel download_model_; | 50 DownloadItemModel download_model_; |
| 50 | 51 |
| 51 // The objective-c controller object. | 52 // The objective-c controller object. |
| 52 DownloadItemController* item_controller_; // weak, owns us. | 53 DownloadItemController* item_controller_; // weak, owns us. |
| 53 | 54 |
| 54 // For canceling an in progress icon request. | 55 // For canceling an in progress icon request. |
| 55 base::CancelableTaskTracker cancelable_task_tracker_; | 56 base::CancelableTaskTracker cancelable_task_tracker_; |
| 56 | 57 |
| 57 // Stores the last known path where the file will be saved. | 58 // Stores the last known path where the file will be saved. |
| 58 base::FilePath lastFilePath_; | 59 base::FilePath lastFilePath_; |
| 59 | 60 |
| 60 DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); | 61 DISALLOW_COPY_AND_ASSIGN(DownloadItemMac); |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ | 64 #endif // CHROME_BROWSER_UI_COCOA_DOWNLOAD_DOWNLOAD_ITEM_MAC_H_ |
| OLD | NEW |