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 // A ChromeView that implements one download on the Download shelf. | 5 // A ChromeView that implements one download on the Download shelf. |
6 // Each DownloadItemView contains an application icon, a text label | 6 // Each DownloadItemView contains an application icon, a text label |
7 // indicating the download's file name, a text label indicating the | 7 // indicating the download's file name, a text label indicating the |
8 // download's status (such as the number of bytes downloaded so far) | 8 // download's status (such as the number of bytes downloaded so far) |
9 // and a button for canceling an in progress download, or opening | 9 // and a button for canceling an in progress download, or opening |
10 // the completed download. | 10 // the completed download. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void UpdateDownloadProgress(); | 67 void UpdateDownloadProgress(); |
68 void StartDownloadProgress(); | 68 void StartDownloadProgress(); |
69 void StopDownloadProgress(); | 69 void StopDownloadProgress(); |
70 | 70 |
71 // IconManager::Client interface. | 71 // IconManager::Client interface. |
72 void OnExtractIconComplete(IconManager::Handle handle, gfx::Image* icon); | 72 void OnExtractIconComplete(IconManager::Handle handle, gfx::Image* icon); |
73 | 73 |
74 // Returns the DownloadItem model object belonging to this item. | 74 // Returns the DownloadItem model object belonging to this item. |
75 content::DownloadItem* download() const { return download_; } | 75 content::DownloadItem* download() const { return download_; } |
76 | 76 |
77 // DownloadObserver method | 77 // DownloadObserver methods |
78 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 78 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
79 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 79 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; |
| 80 virtual void OnDownloadDestructed(content::DownloadItem* download) OVERRIDE; |
80 | 81 |
81 // Overridden from views::View: | 82 // Overridden from views::View: |
82 virtual void Layout() OVERRIDE; | 83 virtual void Layout() OVERRIDE; |
83 virtual gfx::Size GetPreferredSize() OVERRIDE; | 84 virtual gfx::Size GetPreferredSize() OVERRIDE; |
84 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 85 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
85 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 86 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
86 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 87 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
87 virtual void OnMouseCaptureLost() OVERRIDE; | 88 virtual void OnMouseCaptureLost() OVERRIDE; |
88 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; | 89 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; |
89 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | 90 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 307 |
307 // The icon loaded in the download shelf is based on the file path of the | 308 // The icon loaded in the download shelf is based on the file path of the |
308 // item. Store the path used, so that we can detect a change in the path | 309 // item. Store the path used, so that we can detect a change in the path |
309 // and reload the icon. | 310 // and reload the icon. |
310 FilePath last_download_item_path_; | 311 FilePath last_download_item_path_; |
311 | 312 |
312 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); | 313 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); |
313 }; | 314 }; |
314 | 315 |
315 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ | 316 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ |
OLD | NEW |