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

Unified Diff: components/power/origin_power_map.cc

Issue 519883002: Update the Website Settings page when the power consumption is updated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bug where the Origin Map may not exist in tests. Created 6 years, 3 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/power/origin_power_map.cc
diff --git a/components/power/origin_power_map.cc b/components/power/origin_power_map.cc
index dfb0f172a93d510d5d013c9ae39b47717f731f71..4ce32e28f0cbfa74abb4403e723ac7917eb5d4d9 100644
--- a/components/power/origin_power_map.cc
+++ b/components/power/origin_power_map.cc
@@ -49,4 +49,14 @@ OriginPowerMap::PercentOriginMap OriginPowerMap::GetPercentOriginMap() {
return percent_map;
}
+scoped_ptr<OriginPowerMap::Subscription>
+OriginPowerMap::AddPowerConsumptionUpdatedCallback(
+ const base::Closure& callback) {
+ return callback_list_.Add(callback);
+}
+
+void OriginPowerMap::OnAllOriginsUpdated() {
+ callback_list_.Notify();
+}
+
} // namespace power
« no previous file with comments | « components/power/origin_power_map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698