Chromium Code Reviews| 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_DOWNLOAD_DOWNLOAD_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 #if !defined(OS_ANDROID) | 38 #if !defined(OS_ANDROID) |
| 39 ExtensionDownloadsEventRouter* GetExtensionEventRouter() { | 39 ExtensionDownloadsEventRouter* GetExtensionEventRouter() { |
| 40 return extension_event_router_.get(); | 40 return extension_event_router_.get(); |
| 41 } | 41 } |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 // Has a download manager been created? | 44 // Has a download manager been created? |
| 45 bool HasCreatedDownloadManager(); | 45 bool HasCreatedDownloadManager(); |
| 46 | 46 |
| 47 // Number of downloads associated with this instance of the service. | 47 // Number of downloads associated with this instance of the service. |
| 48 int DownloadCount() const; | 48 int DownloadCount() const; |
|
asanka
2013/10/11 16:02:35
Are DownloadCount() and DownloadCountAllProfiles()
felt
2013/10/11 17:26:44
They seemed like potentially useful utility functi
| |
| 49 | 49 |
| 50 // Number of non-dangerous downloads associated with this instance of the | |
| 51 // service. This excludes downloads that are marked as dangerous. | |
| 52 int NonDangerousDownloadCount() const; | |
| 53 | |
| 50 // Number of downloads associated with all profiles. | 54 // Number of downloads associated with all profiles. |
| 51 static int DownloadCountAllProfiles(); | 55 static int DownloadCountAllProfiles(); |
| 52 | 56 |
| 57 // Number of non-dangerous downloads associated with all profiles. | |
| 58 // This excludes downloads that are marked as dangerous. | |
| 59 static int NonDangerousDownloadCountAllProfiles(); | |
| 60 | |
| 53 // Sets the DownloadManagerDelegate associated with this object and | 61 // Sets the DownloadManagerDelegate associated with this object and |
| 54 // its DownloadManager. Takes ownership of |delegate|, and destroys | 62 // its DownloadManager. Takes ownership of |delegate|, and destroys |
| 55 // the previous delegate. For testing. | 63 // the previous delegate. For testing. |
| 56 void SetDownloadManagerDelegateForTesting( | 64 void SetDownloadManagerDelegateForTesting( |
| 57 ChromeDownloadManagerDelegate* delegate); | 65 ChromeDownloadManagerDelegate* delegate); |
| 58 | 66 |
| 59 // Will be called to release references on other services as part | 67 // Will be called to release references on other services as part |
| 60 // of Profile shutdown. | 68 // of Profile shutdown. |
| 61 virtual void Shutdown() OVERRIDE; | 69 virtual void Shutdown() OVERRIDE; |
| 62 | 70 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 91 // should be a separate EDER for on-record and off-record managers. | 99 // should be a separate EDER for on-record and off-record managers. |
| 92 // There does not appear to be a separate ExtensionSystem for on-record and | 100 // There does not appear to be a separate ExtensionSystem for on-record and |
| 93 // off-record profiles, so ExtensionSystem cannot own the EDER. | 101 // off-record profiles, so ExtensionSystem cannot own the EDER. |
| 94 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; | 102 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; |
| 95 #endif | 103 #endif |
| 96 | 104 |
| 97 DISALLOW_COPY_AND_ASSIGN(DownloadService); | 105 DISALLOW_COPY_AND_ASSIGN(DownloadService); |
| 98 }; | 106 }; |
| 99 | 107 |
| 100 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ | 108 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| OLD | NEW |