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

Unified Diff: components/power/origin_power_map_factory.cc

Issue 447053002: Add Origin Power Map to Store Battery Auditing Data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/power/origin_power_map_factory.h ('k') | components/power/origin_power_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/power/origin_power_map_factory.cc
diff --git a/components/power/origin_power_map_factory.cc b/components/power/origin_power_map_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8553aec96aa59e16aa93898a49162225834a7948
--- /dev/null
+++ b/components/power/origin_power_map_factory.cc
@@ -0,0 +1,38 @@
+// 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 "components/power/origin_power_map_factory.h"
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/power/origin_power_map.h"
+
+namespace power {
+// static
+OriginPowerMap* OriginPowerMapFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<OriginPowerMap*>(
+ GetInstance()->GetServiceForBrowserContext(context, 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();
+}
+
+} // namespace power
« no previous file with comments | « components/power/origin_power_map_factory.h ('k') | components/power/origin_power_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698