| Index: chrome/browser/ui/webui/options/website_settings_handler.h
|
| diff --git a/chrome/browser/ui/webui/options/website_settings_handler.h b/chrome/browser/ui/webui/options/website_settings_handler.h
|
| index 2ebf495840f6529979385b174bd8e1e425c99443..717faaa72ee11ea1182f94dba6a94f3907b37399 100644
|
| --- a/chrome/browser/ui/webui/options/website_settings_handler.h
|
| +++ b/chrome/browser/ui/webui/options/website_settings_handler.h
|
| @@ -15,10 +15,13 @@
|
| #include "chrome/browser/content_settings/host_content_settings_map.h"
|
| #include "chrome/browser/content_settings/local_shared_objects_container.h"
|
| #include "chrome/browser/ui/webui/options/options_ui.h"
|
| +#include "components/power/origin_power_map.h"
|
| +#include "components/power/origin_power_map_observer.h"
|
|
|
| namespace options {
|
|
|
| class WebsiteSettingsHandler : public content_settings::Observer,
|
| + public power::OriginPowerMapObserver,
|
| public OptionsPageUIHandler {
|
| public:
|
| WebsiteSettingsHandler();
|
| @@ -44,6 +47,9 @@ class WebsiteSettingsHandler : public content_settings::Observer,
|
| const ContentSettingsPattern& secondary_pattern,
|
| ContentSettingsType content_type) OVERRIDE;
|
|
|
| + // power::OriginPowerMapObserver implementation.
|
| + virtual void OnPowerConsumptionUpdated() OVERRIDE;
|
| +
|
| private:
|
| // Update the page with all origins for a given content setting.
|
| // |args| is the string name of the content setting.
|
| @@ -92,6 +98,10 @@ class WebsiteSettingsHandler : public content_settings::Observer,
|
| // and update the page.
|
| void UpdateLocalStorage();
|
|
|
| + // Get all origins with power consumption, filter them by |last_filter_|,
|
| + // and update the page.
|
| + void UpdateBatteryUsage();
|
| +
|
| // Kill all tabs and app windows which have the same origin as |site_url|.
|
| void StopOrigin(const GURL& site_url);
|
|
|
| @@ -118,6 +128,9 @@ class WebsiteSettingsHandler : public content_settings::Observer,
|
| // Observer to watch for content settings changes.
|
| ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
|
|
|
| + // Observer to watch for power consumption changes.
|
| + ScopedObserver<power::OriginPowerMap, OriginPowerMapObserver> power_observer_;
|
| +
|
| base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler);
|
|
|