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_SYNC_SESSIONS_SYNC_SESSIONS_WEB_CONTENTS_ROUTER_FACTORY_H
_ |
| 6 #define CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSIONS_WEB_CONTENTS_ROUTER_FACTORY_H
_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 |
| 11 class Profile; |
| 12 |
| 13 namespace base { |
| 14 template <typename T> |
| 15 struct DefaultSingletonTraits; |
| 16 } // namespace base |
| 17 |
| 18 namespace sync_sessions { |
| 19 |
| 20 class SyncSessionsWebContentsRouter; |
| 21 |
| 22 class SyncSessionsWebContentsRouterFactory |
| 23 : public BrowserContextKeyedServiceFactory { |
| 24 public: |
| 25 // Get the SyncSessionsWebContentsRouter service for |profile|, creating one |
| 26 // if needed. |
| 27 static SyncSessionsWebContentsRouter* GetForProfile(Profile* profile); |
| 28 |
| 29 // Get the singleton instance of the factory. |
| 30 static SyncSessionsWebContentsRouterFactory* GetInstance(); |
| 31 |
| 32 // Creates a SyncSessionsWebContentsRouter service for |context|. |
| 33 static SyncSessionsWebContentsRouter* BuildSyncSessionsWebContentsRouter( |
| 34 content::BrowserContext* context); |
| 35 |
| 36 private: |
| 37 friend struct base::DefaultSingletonTraits< |
| 38 SyncSessionsWebContentsRouterFactory>; |
| 39 |
| 40 SyncSessionsWebContentsRouterFactory(); |
| 41 ~SyncSessionsWebContentsRouterFactory() override; |
| 42 |
| 43 // Overridden from BrowserContextKeyedServiceFactory. |
| 44 KeyedService* BuildServiceInstanceFor( |
| 45 content::BrowserContext* context) const override; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(SyncSessionsWebContentsRouterFactory); |
| 48 }; |
| 49 |
| 50 } // namespace sync_sessions |
| 51 |
| 52 #endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSIONS_WEB_CONTENTS_ROUTER_FACTOR
Y_H_ |
OLD | NEW |