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

Unified Diff: chrome/browser/ui/webui/options/website_settings_handler.h

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: Remove the Observer, replace with Subscription. 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
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..fd8382965d5fede9b4f6dc06b0057e49de04ba73 100644
--- a/chrome/browser/ui/webui/options/website_settings_handler.h
+++ b/chrome/browser/ui/webui/options/website_settings_handler.h
@@ -15,6 +15,7 @@
#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"
namespace options {
@@ -92,6 +93,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 +123,9 @@ class WebsiteSettingsHandler : public content_settings::Observer,
// Observer to watch for content settings changes.
ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
+ // Subscription to watch for power consumption updates.
+ scoped_ptr<power::OriginPowerMap::Subscription> subscription_;
+
base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler);

Powered by Google App Engine
This is Rietveld 408576698