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

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

Issue 408493003: Show local storage usage on the Website Settings options page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add caching. Created 6 years, 5 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 bce6bf24bd4b6e75d1f4dd782cf36eac569490b6..f8172bca4d740c2fd7173e66dee81ebed8fbffe4 100644
--- a/chrome/browser/ui/webui/options/website_settings_handler.h
+++ b/chrome/browser/ui/webui/options/website_settings_handler.h
@@ -9,7 +9,9 @@
#include "base/basictypes.h"
#include "base/macros.h"
+#include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
#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 "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -21,6 +23,9 @@ class WebsiteSettingsHandler : public OptionsPageUIHandler {
WebsiteSettingsHandler();
virtual ~WebsiteSettingsHandler();
+ typedef std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo>
+ LocalStorageList;
+
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
base::DictionaryValue* localized_strings) OVERRIDE;
@@ -35,11 +40,26 @@ class WebsiteSettingsHandler : public OptionsPageUIHandler {
// |args| is the filter string.
void HandleUpdateSearchResults(const base::ListValue* args);
+ // Update the page with all origins that are using local storage.
+ void HandleUpdateLocalStorage(const base::ListValue* args);
+
+ // Callback method to be invoked when fetching the data is complete.
+ void OnLocalStorageFetched(const LocalStorageList& storage);
+
// Get all origins with Content Settings for the last given content setting,
// filter them by |filter|, and update the page.
void UpdateOrigins(const std::string& filter);
- ContentSettingsType last_setting_;
+ // Get all origins with local storage usage, filter them by |filter|, and
+ // update the page.
+ void UpdateLocalStorage(const std::string& filter);
+
+ std::string last_setting_;
+ std::string last_filter_;
+ scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_;
+ LocalStorageList local_storage_list_;
+
+ base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler);
};

Powered by Google App Engine
This is Rietveld 408576698