Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory.cc

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)
Patch Set: use base:MakeUnique, alphabetize Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698