Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: chrome/browser/download/download_service_factory.h

Issue 2851303003: Add the download component and initial setup (Closed)
Patch Set: Addressed comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/download/download_service_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_DOWNLOAD_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_DOWNLOAD_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 DownloadService;
22 } // namespace download
23
24 // DownloadServiceFactory is the main client class for interaction with the
25 // download component.
26 class DownloadServiceFactory : public BrowserContextKeyedServiceFactory {
27 public:
28 // Returns singleton instance of DownloadServiceFactory.
29 static DownloadServiceFactory* GetInstance();
30
31 // Returns the DownloadService associated with |context|.
32 static download::DownloadService* GetForBrowserContext(
33 content::BrowserContext* context);
34
35 private:
36 friend struct base::DefaultSingletonTraits<DownloadServiceFactory>;
37
38 DownloadServiceFactory();
39 ~DownloadServiceFactory() override;
40
41 // BrowserContextKeyedServiceFactory overrides:
42 KeyedService* BuildServiceInstanceFor(
43 content::BrowserContext* context) const override;
44 content::BrowserContext* GetBrowserContextToUse(
45 content::BrowserContext* context) const override;
46
47 DISALLOW_COPY_AND_ASSIGN(DownloadServiceFactory);
48 };
49
50 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/download/download_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698