OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_BACKGROUND_DOWNLOAD_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_BACKGROUND_DOWNLOAD_SERVICE_FACTORY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 |
| 11 namespace base { |
| 12 template <typename T> |
| 13 struct DefaultSingletonTraits; |
| 14 } // namespace base |
| 15 |
| 16 namespace content { |
| 17 class BrowserContext; |
| 18 } // namespace content |
| 19 |
| 20 namespace download { |
| 21 class BackgroundDownloadService; |
| 22 } // namespace download |
| 23 |
| 24 // BackgroundDownloadServiceFactory is the main client class for interaction |
| 25 // with the downloads component. |
| 26 class BackgroundDownloadServiceFactory |
| 27 : public BrowserContextKeyedServiceFactory { |
| 28 public: |
| 29 // Returns singleton instance of InternalDownloadServiceFactory. |
| 30 static BackgroundDownloadServiceFactory* GetInstance(); |
| 31 |
| 32 // Returns the DownloadService associated with |context|. |
| 33 static download::BackgroundDownloadService* GetForBrowserContext( |
| 34 content::BrowserContext* context); |
| 35 |
| 36 private: |
| 37 friend struct base::DefaultSingletonTraits<BackgroundDownloadServiceFactory>; |
| 38 |
| 39 BackgroundDownloadServiceFactory(); |
| 40 ~BackgroundDownloadServiceFactory() override; |
| 41 |
| 42 // BrowserContextKeyedServiceFactory overrides: |
| 43 KeyedService* BuildServiceInstanceFor( |
| 44 content::BrowserContext* context) const override; |
| 45 content::BrowserContext* GetBrowserContextToUse( |
| 46 content::BrowserContext* context) const override; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(BackgroundDownloadServiceFactory); |
| 49 }; |
| 50 |
| 51 #endif // CHROME_BROWSER_DOWNLOAD_BACKGROUND_DOWNLOAD_SERVICE_FACTORY_H_ |
OLD | NEW |