| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 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 non-malicious downloads associated with this instance of the |
| 48 int DownloadCount() const; | 48 // service. |
| 49 int NonMaliciousDownloadCount() const; |
| 49 | 50 |
| 50 // Number of downloads associated with all profiles. | 51 // Number of non-malicious downloads associated with all profiles. |
| 51 static int DownloadCountAllProfiles(); | 52 static int NonMaliciousDownloadCountAllProfiles(); |
| 52 | 53 |
| 53 // Sets the DownloadManagerDelegate associated with this object and | 54 // Sets the DownloadManagerDelegate associated with this object and |
| 54 // its DownloadManager. Takes ownership of |delegate|, and destroys | 55 // its DownloadManager. Takes ownership of |delegate|, and destroys |
| 55 // the previous delegate. For testing. | 56 // the previous delegate. For testing. |
| 56 void SetDownloadManagerDelegateForTesting( | 57 void SetDownloadManagerDelegateForTesting( |
| 57 ChromeDownloadManagerDelegate* delegate); | 58 ChromeDownloadManagerDelegate* delegate); |
| 58 | 59 |
| 59 // Will be called to release references on other services as part | 60 // Will be called to release references on other services as part |
| 60 // of Profile shutdown. | 61 // of Profile shutdown. |
| 61 virtual void Shutdown() OVERRIDE; | 62 virtual void Shutdown() OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 // should be a separate EDER for on-record and off-record managers. | 92 // 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 | 93 // There does not appear to be a separate ExtensionSystem for on-record and |
| 93 // off-record profiles, so ExtensionSystem cannot own the EDER. | 94 // off-record profiles, so ExtensionSystem cannot own the EDER. |
| 94 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; | 95 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; |
| 95 #endif | 96 #endif |
| 96 | 97 |
| 97 DISALLOW_COPY_AND_ASSIGN(DownloadService); | 98 DISALLOW_COPY_AND_ASSIGN(DownloadService); |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ | 101 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| OLD | NEW |