Index: chrome/browser/power/origin_power_map_factory.cc |
diff --git a/chrome/browser/power/origin_power_map_factory.cc b/chrome/browser/power/origin_power_map_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..59654a77e2f55f17584d99fba5c06579600ef14e |
--- /dev/null |
+++ b/chrome/browser/power/origin_power_map_factory.cc |
@@ -0,0 +1,35 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/power/origin_power_map_factory.h" |
+ |
+#include "base/memory/singleton.h" |
+#include "chrome/browser/power/origin_power_map.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "components/keyed_service/content/browser_context_dependency_manager.h" |
+ |
+// static |
+OriginPowerMap* OriginPowerMapFactory::GetForProfile(Profile* profile) { |
+ return static_cast<OriginPowerMap*>( |
+ GetInstance()->GetServiceForBrowserContext(profile, true)); |
+} |
+ |
+// static |
+OriginPowerMapFactory* OriginPowerMapFactory::GetInstance() { |
+ return Singleton<OriginPowerMapFactory>::get(); |
+} |
+ |
+OriginPowerMapFactory::OriginPowerMapFactory() |
+ : BrowserContextKeyedServiceFactory( |
+ "OriginPowerMap", |
+ BrowserContextDependencyManager::GetInstance()) { |
+} |
+ |
+OriginPowerMapFactory::~OriginPowerMapFactory() { |
+} |
+ |
+KeyedService* OriginPowerMapFactory::BuildServiceInstanceFor( |
+ content::BrowserContext* context) const { |
+ return new OriginPowerMap(); |
+} |