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

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

Issue 1844753002: Histogram the scheme of an origin on the 1st navigation to it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplifications thanks to avi. Created 4 years, 8 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 2016 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 #include "chrome/browser/tab_contents/origins_seen_service_factory.h"
6
7 #include "chrome/browser/profiles/incognito_helpers.h"
Avi (use Gerrit) 2016/04/14 19:08:02 Do you need this?
palmer 2016/04/14 20:13:41 Done.
8 #include "chrome/browser/profiles/profile.h"
Avi (use Gerrit) 2016/04/14 19:08:02 You don't need this line...
palmer 2016/04/14 20:13:41 Done.
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10
11 // static
12 OriginsSeenService* OriginsSeenServiceFactory::GetForBrowserContext(
13 content::BrowserContext* context) {
14 return static_cast<OriginsSeenService*>(
15 GetInstance()->GetServiceForBrowserContext(context, true));
16 }
17
18 // static
19 OriginsSeenServiceFactory* OriginsSeenServiceFactory::GetInstance() {
20 return base::Singleton<OriginsSeenServiceFactory>::get();
21 }
22
23 // static
24 KeyedService* OriginsSeenServiceFactory::BuildInstanceFor(
25 content::BrowserContext* context) {
26 return new OriginsSeenService();
27 }
28
29 OriginsSeenServiceFactory::OriginsSeenServiceFactory()
30 : BrowserContextKeyedServiceFactory(
31 "OriginsSeenService",
32 BrowserContextDependencyManager::GetInstance()) {}
33
34 OriginsSeenServiceFactory::~OriginsSeenServiceFactory() {}
35
36 KeyedService* OriginsSeenServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
Avi (use Gerrit) 2016/04/14 19:08:02 |context|, not |profile|.
palmer 2016/04/14 20:13:41 Done.
38 return BuildInstanceFor(static_cast<Profile*>(profile));
Avi (use Gerrit) 2016/04/14 19:08:02 ... because you don't need this cast, as BuildInst
palmer 2016/04/14 20:13:41 Done.
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698