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 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory .h" | |
| 5 | |
| 6 #include "base/logging.h" | |
| 7 #include "base/memory/singleton.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h" | |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 11 | |
| 12 namespace sync_sessions { | |
|
Nicolas Zea
2017/03/16 19:57:43
nit: newline below
Patrick Noland
2017/03/17 00:20:10
Done.
| |
| 13 // static | |
| 14 SyncSessionsWebContentsRouter* | |
| 15 SyncSessionsWebContentsRouterFactory::GetForProfile(Profile* profile) { | |
| 16 return static_cast<SyncSessionsWebContentsRouter*>( | |
| 17 GetInstance()->GetServiceForBrowserContext(profile, true)); | |
| 18 } | |
| 19 | |
| 20 // static | |
| 21 SyncSessionsWebContentsRouterFactory* | |
| 22 SyncSessionsWebContentsRouterFactory::GetInstance() { | |
| 23 return base::Singleton<SyncSessionsWebContentsRouterFactory>::get(); | |
| 24 } | |
| 25 | |
| 26 SyncSessionsWebContentsRouterFactory::SyncSessionsWebContentsRouterFactory() | |
| 27 : BrowserContextKeyedServiceFactory( | |
| 28 "SyncSessionsWebContentsRouter", | |
| 29 BrowserContextDependencyManager::GetInstance()) {} | |
| 30 | |
| 31 SyncSessionsWebContentsRouterFactory::~SyncSessionsWebContentsRouterFactory() {} | |
| 32 | |
| 33 KeyedService* SyncSessionsWebContentsRouterFactory::BuildServiceInstanceFor( | |
| 34 content::BrowserContext* context) const { | |
| 35 return new SyncSessionsWebContentsRouter(static_cast<Profile*>(context)); | |
| 36 } | |
| 37 | |
| 38 } // namespace sync_sessions | |
| OLD | NEW |