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