OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_EVENT_ROUTER_FACTOR
Y_H_ |
| 6 #define EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_EVENT_ROUTER_FACTOR
Y_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/singleton.h" |
| 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 11 |
| 12 namespace extensions { |
| 13 |
| 14 class DisplaySourceEventRouter; |
| 15 |
| 16 class DisplaySourceEventRouterFactory |
| 17 : public BrowserContextKeyedServiceFactory { |
| 18 public: |
| 19 // Returns the DisplaySourceEventRouter for |profile|, creating it if |
| 20 // it is not yet created. |
| 21 static DisplaySourceEventRouter* GetForProfile( |
| 22 content::BrowserContext* context); |
| 23 |
| 24 static DisplaySourceEventRouterFactory* GetInstance(); |
| 25 |
| 26 protected: |
| 27 // BrowserContextKeyedBaseFactory overrides: |
| 28 content::BrowserContext* GetBrowserContextToUse( |
| 29 content::BrowserContext* context) const override; |
| 30 bool ServiceIsCreatedWithBrowserContext() const override; |
| 31 bool ServiceIsNULLWhileTesting() const override; |
| 32 |
| 33 private: |
| 34 friend struct base::DefaultSingletonTraits<DisplaySourceEventRouterFactory>; |
| 35 |
| 36 DisplaySourceEventRouterFactory(); |
| 37 ~DisplaySourceEventRouterFactory() override; |
| 38 |
| 39 // BrowserContextKeyedServiceFactory: |
| 40 KeyedService* BuildServiceInstanceFor( |
| 41 content::BrowserContext* profile) const override; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(DisplaySourceEventRouterFactory); |
| 44 }; |
| 45 |
| 46 } // namespace extensions |
| 47 |
| 48 #endif // EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_DISPLAY_SOURCE_EVENT_ROUTER_FAC
TORY_H_ |
OLD | NEW |