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 |
| 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 12 |
| 13 namespace sync_sessions { |
| 14 |
| 15 // static |
| 16 SyncSessionsWebContentsRouter* |
| 17 SyncSessionsWebContentsRouterFactory::GetForProfile(Profile* profile) { |
| 18 return static_cast<SyncSessionsWebContentsRouter*>( |
| 19 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 20 } |
| 21 |
| 22 // static |
| 23 SyncSessionsWebContentsRouterFactory* |
| 24 SyncSessionsWebContentsRouterFactory::GetInstance() { |
| 25 return base::Singleton<SyncSessionsWebContentsRouterFactory>::get(); |
| 26 } |
| 27 |
| 28 SyncSessionsWebContentsRouterFactory::SyncSessionsWebContentsRouterFactory() |
| 29 : BrowserContextKeyedServiceFactory( |
| 30 "SyncSessionsWebContentsRouter", |
| 31 BrowserContextDependencyManager::GetInstance()) {} |
| 32 |
| 33 SyncSessionsWebContentsRouterFactory::~SyncSessionsWebContentsRouterFactory() {} |
| 34 |
| 35 KeyedService* SyncSessionsWebContentsRouterFactory::BuildServiceInstanceFor( |
| 36 content::BrowserContext* context) const { |
| 37 return new SyncSessionsWebContentsRouter(static_cast<Profile*>(context)); |
| 38 } |
| 39 |
| 40 } // namespace sync_sessions |
OLD | NEW |