OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHROMEOS_PRINTER_DETECTOR_PRINTER_DETECTOR_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_PRINTER_DETECTOR_FACTORY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_PRINTER_DETECTOR_FACTORY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_PRINTER_DETECTOR_FACTORY_H_ |
7 | 7 |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" |
11 #include "extensions/browser/extension_system_provider.h" | 11 #include "extensions/browser/extension_system_provider.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class BrowserContext; | 14 class BrowserContext; |
15 } | 15 } |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 | 18 |
19 class PrinterDetector; | 19 class PrinterDetector; |
20 | 20 |
21 class PrinterDetectorFactory : public BrowserContextKeyedServiceFactory { | 21 class PrinterDetectorFactory : public BrowserContextKeyedServiceFactory { |
22 public: | 22 public: |
23 static PrinterDetectorFactory* GetInstance(); | 23 static PrinterDetectorFactory* GetInstance(); |
24 | 24 |
25 PrinterDetector* Get(content::BrowserContext* context); | 25 PrinterDetector* Get(content::BrowserContext* context); |
26 | 26 |
27 protected: | |
28 content::BrowserContext* GetBrowserContextToUse( | |
Daniel Erat
2017/05/22 22:29:37
nit: mind adding a comment above this line to make
skau
2017/05/22 23:49:11
Done.
| |
29 content::BrowserContext* context) const override; | |
30 | |
27 private: | 31 private: |
28 friend struct base::LazyInstanceTraitsBase<PrinterDetectorFactory>; | 32 friend struct base::LazyInstanceTraitsBase<PrinterDetectorFactory>; |
29 PrinterDetectorFactory(); | 33 PrinterDetectorFactory(); |
30 ~PrinterDetectorFactory() override; | 34 ~PrinterDetectorFactory() override; |
31 | 35 |
32 KeyedService* BuildServiceInstanceFor( | 36 KeyedService* BuildServiceInstanceFor( |
33 content::BrowserContext* browser_context) const override; | 37 content::BrowserContext* browser_context) const override; |
34 bool ServiceIsCreatedWithBrowserContext() const override; | 38 bool ServiceIsCreatedWithBrowserContext() const override; |
35 bool ServiceIsNULLWhileTesting() const override; | 39 bool ServiceIsNULLWhileTesting() const override; |
36 | 40 |
37 DISALLOW_COPY_AND_ASSIGN(PrinterDetectorFactory); | 41 DISALLOW_COPY_AND_ASSIGN(PrinterDetectorFactory); |
38 }; | 42 }; |
39 | 43 |
40 } // namespace chromeos | 44 } // namespace chromeos |
41 | 45 |
42 #endif // CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_PRINTER_DETECTOR_FACTORY_H_ | 46 #endif // CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_PRINTER_DETECTOR_FACTORY_H_ |
OLD | NEW |