OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UI_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UI_CONTROLLER_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "chrome/browser/download/all_download_item_notifier.h" |
| 11 |
| 12 class Profile; |
| 13 |
| 14 namespace content { |
| 15 class WebContents; |
| 16 } |
| 17 |
| 18 // This class handles the task of observing for download notifications and |
| 19 // notifying the UI when a new download should be displayed in the UI. |
| 20 // |
| 21 // On Android the target of the notification is DownloadControllerAndroid. |
| 22 // |
| 23 // On platforms that are not Android the target of this notification is a |
| 24 // Browser object. This class is responsible for determining which Browser to |
| 25 // notify. |
| 26 // |
| 27 // This class monitors each IN_PROGRESS download that is created (for which |
| 28 // OnDownloadCreated is called) until: |
| 29 // - it is assigned a target path or |
| 30 // - is interrupted. |
| 31 // Then the appropriate class is notified of the download. |
| 32 class DownloadUIController : public AllDownloadItemNotifier::Observer { |
| 33 public: |
| 34 DownloadUIController(Profile* profile, |
| 35 content::DownloadManager* manager); |
| 36 |
| 37 virtual ~DownloadUIController(); |
| 38 |
| 39 private: |
| 40 virtual void OnDownloadCreated(content::DownloadManager* manager, |
| 41 content::DownloadItem* item) OVERRIDE; |
| 42 virtual void OnDownloadUpdated(content::DownloadManager* manager, |
| 43 content::DownloadItem* item) OVERRIDE; |
| 44 |
| 45 void NotifyDownloadStarting(content::DownloadItem* item); |
| 46 |
| 47 AllDownloadItemNotifier notifier_; |
| 48 |
| 49 Profile* profile_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(DownloadUIController); |
| 52 }; |
| 53 |
| 54 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UI_CONTROLLER_H_ |
OLD | NEW |