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

Side by Side Diff: chrome/browser/tab_contents/origins_seen_service_factory.cc

Issue 1897343003: Componentize OriginsSeenService & provide iOS factory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address nit Created 4 years, 7 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
« no previous file with comments | « chrome/browser/tab_contents/origins_seen_service_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/origins_seen_service_factory.h" 5 #include "chrome/browser/tab_contents/origins_seen_service_factory.h"
6 6
7 #include "chrome/browser/profiles/incognito_helpers.h" 7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "components/navigation_metrics/origins_seen_service.h"
9 10
10 // static 11 // static
11 OriginsSeenService* OriginsSeenServiceFactory::GetForBrowserContext( 12 navigation_metrics::OriginsSeenService*
13 OriginsSeenServiceFactory::GetForBrowserContext(
12 content::BrowserContext* context) { 14 content::BrowserContext* context) {
13 return static_cast<OriginsSeenService*>( 15 return static_cast<navigation_metrics::OriginsSeenService*>(
14 GetInstance()->GetServiceForBrowserContext(context, true)); 16 GetInstance()->GetServiceForBrowserContext(context, true));
15 } 17 }
16 18
17 // static 19 // static
18 OriginsSeenServiceFactory* OriginsSeenServiceFactory::GetInstance() { 20 OriginsSeenServiceFactory* OriginsSeenServiceFactory::GetInstance() {
19 return base::Singleton<OriginsSeenServiceFactory>::get(); 21 return base::Singleton<OriginsSeenServiceFactory>::get();
20 } 22 }
21 23
22 // static 24 // static
23 KeyedService* OriginsSeenServiceFactory::BuildInstanceFor( 25 KeyedService* OriginsSeenServiceFactory::BuildInstanceFor(
24 content::BrowserContext* context) { 26 content::BrowserContext* context) {
25 return new OriginsSeenService(); 27 return new navigation_metrics::OriginsSeenService();
26 } 28 }
27 29
28 OriginsSeenServiceFactory::OriginsSeenServiceFactory() 30 OriginsSeenServiceFactory::OriginsSeenServiceFactory()
29 : BrowserContextKeyedServiceFactory( 31 : BrowserContextKeyedServiceFactory(
30 "OriginsSeenService", 32 "OriginsSeenService",
31 BrowserContextDependencyManager::GetInstance()) {} 33 BrowserContextDependencyManager::GetInstance()) {}
32 34
33 OriginsSeenServiceFactory::~OriginsSeenServiceFactory() {} 35 OriginsSeenServiceFactory::~OriginsSeenServiceFactory() {}
34 36
35 content::BrowserContext* OriginsSeenServiceFactory::GetBrowserContextToUse( 37 content::BrowserContext* OriginsSeenServiceFactory::GetBrowserContextToUse(
36 content::BrowserContext* context) const { 38 content::BrowserContext* context) const {
37 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 39 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
38 } 40 }
39 41
40 KeyedService* OriginsSeenServiceFactory::BuildServiceInstanceFor( 42 KeyedService* OriginsSeenServiceFactory::BuildServiceInstanceFor(
41 content::BrowserContext* context) const { 43 content::BrowserContext* context) const {
42 return BuildInstanceFor(context); 44 return BuildInstanceFor(context);
43 } 45 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/origins_seen_service_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698