Index: components/power/origin_power_map.h |
diff --git a/components/power/origin_power_map.h b/components/power/origin_power_map.h |
index 0936be46d8af98264316927e9e404a7bba9da170..5a65fcb62c65ac8d2aed911228e984ea0f2e1ad6 100644 |
--- a/components/power/origin_power_map.h |
+++ b/components/power/origin_power_map.h |
@@ -7,7 +7,9 @@ |
#include <map> |
+#include "base/observer_list.h" |
#include "components/keyed_service/core/keyed_service.h" |
+#include "components/power/origin_power_map_observer.h" |
#include "url/gurl.h" |
namespace power { |
@@ -33,6 +35,14 @@ class OriginPowerMap : public KeyedService { |
// consumed. |
PercentOriginMap GetPercentOriginMap(); |
+ // Adds/removes observer. |
+ void AddObserver(OriginPowerMapObserver* observer); |
+ void RemoveObserver(OriginPowerMapObserver* observer); |
+ |
+ // Notifies observers to let them know that the origin power map has finished |
+ // updating. |
+ void OnPowerConsumptionUpdated(); |
Daniel Erat
2014/08/29 21:14:02
mind giving this a different name from the OriginP
Daniel Nishi
2014/09/02 16:30:30
Done.
|
+ |
private: |
// OriginMap maps a URL to the amount of power consumed by the URL using the |
// same units as |total_consumed_|. |
@@ -43,6 +53,8 @@ class OriginPowerMap : public KeyedService { |
// the power heuristics available to the platform. |
double total_consumed_; |
+ ObserverList<OriginPowerMapObserver> observers_; |
+ |
DISALLOW_COPY_AND_ASSIGN(OriginPowerMap); |
}; |