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

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: 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
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..6b6ed672883762cdc5c6ea94eb3d1bbd92e4ca13 100644
--- a/components/power/origin_power_map.cc
+++ b/components/power/origin_power_map.cc
@@ -49,4 +49,17 @@ OriginPowerMap::PercentOriginMap OriginPowerMap::GetPercentOriginMap() {
return percent_map;
}
+void OriginPowerMap::AddObserver(OriginPowerMapObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void OriginPowerMap::RemoveObserver(OriginPowerMapObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void OriginPowerMap::OnPowerConsumptionUpdated() {
+ FOR_EACH_OBSERVER(
+ OriginPowerMapObserver, observers_, OnPowerConsumptionUpdated());
+}
+
} // namespace power

Powered by Google App Engine
This is Rietveld 408576698