Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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/history/top_sites_service_factory.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "chrome/browser/history/top_sites_service.h" | |
| 9 #include "chrome/common/chrome_constants.h" | |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 11 | |
| 12 using namespace history; | |
| 13 | |
| 14 // static | |
| 15 history::TopSitesService* TopSitesServiceFactory::GetForProfile( | |
| 16 Profile* profile) { | |
| 17 return static_cast<history::TopSitesService*>( | |
| 18 GetInstance()->GetServiceForBrowserContext(profile, true)); | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 TopSitesServiceFactory* TopSitesServiceFactory::GetInstance() { | |
| 23 return Singleton<TopSitesServiceFactory>::get(); | |
| 24 } | |
| 25 | |
| 26 TopSitesServiceFactory::TopSitesServiceFactory() | |
| 27 : BrowserContextKeyedServiceFactory( | |
| 28 "TopsitesService", | |
|
sdefresne
2014/12/19 15:11:41
s/TopsitesService/TopSitesService/
Jitu( very slow this week)
2014/12/26 14:04:27
Done.
| |
| 29 BrowserContextDependencyManager::GetInstance()) { | |
| 30 } | |
| 31 | |
| 32 TopSitesServiceFactory::~TopSitesServiceFactory() { | |
| 33 } | |
| 34 | |
| 35 KeyedService* TopSitesServiceFactory::BuildServiceInstanceFor( | |
| 36 content::BrowserContext* profile) const { | |
| 37 TopSitesService* provider = NULL; | |
|
sdefresne
2014/12/19 15:11:41
s/NULL/nullptr/
Jitu( very slow this week)
2014/12/26 14:04:28
Done.
| |
| 38 provider = new TopSitesService(static_cast<Profile*>(profile)); | |
| 39 provider->Init(profile->GetPath().Append(chrome::kTopSitesFilename)); | |
| 40 return provider; | |
| 41 } | |
| OLD | NEW |