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/power/origin_power_map_factory.h" |
| 6 |
| 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/power/origin_power_map.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 11 |
| 12 // static |
| 13 OriginPowerMap* OriginPowerMapFactory::GetForProfile(Profile* profile) { |
| 14 return static_cast<OriginPowerMap*>( |
| 15 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 16 } |
| 17 |
| 18 // static |
| 19 OriginPowerMapFactory* OriginPowerMapFactory::GetInstance() { |
| 20 return Singleton<OriginPowerMapFactory>::get(); |
| 21 } |
| 22 |
| 23 OriginPowerMapFactory::OriginPowerMapFactory() |
| 24 : BrowserContextKeyedServiceFactory( |
| 25 "OriginPowerMap", |
| 26 BrowserContextDependencyManager::GetInstance()) { |
| 27 } |
| 28 |
| 29 OriginPowerMapFactory::~OriginPowerMapFactory() { |
| 30 } |
| 31 |
| 32 KeyedService* OriginPowerMapFactory::BuildServiceInstanceFor( |
| 33 content::BrowserContext* context) const { |
| 34 return new OriginPowerMap(); |
| 35 } |
OLD | NEW |