OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | |
12 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
14 #include "chrome/browser/content_settings/local_shared_objects_container.h" | |
13 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
14 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
16 | 18 |
17 namespace options { | 19 namespace options { |
18 | 20 |
19 class WebsiteSettingsHandler : public OptionsPageUIHandler { | 21 class WebsiteSettingsHandler : public OptionsPageUIHandler { |
20 public: | 22 public: |
21 WebsiteSettingsHandler(); | 23 WebsiteSettingsHandler(); |
22 virtual ~WebsiteSettingsHandler(); | 24 virtual ~WebsiteSettingsHandler(); |
23 | 25 |
26 typedef std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> | |
27 LocalStorageList; | |
28 | |
24 // OptionsPageUIHandler implementation. | 29 // OptionsPageUIHandler implementation. |
25 virtual void GetLocalizedValues( | 30 virtual void GetLocalizedValues( |
26 base::DictionaryValue* localized_strings) OVERRIDE; | 31 base::DictionaryValue* localized_strings) OVERRIDE; |
27 virtual void RegisterMessages() OVERRIDE; | 32 virtual void RegisterMessages() OVERRIDE; |
28 | 33 |
29 private: | 34 private: |
30 // Update the page with all origins for a given content setting. | 35 // Update the page with all origins for a given content setting. |
31 // |args| is the string name of the content setting. | 36 // |args| is the string name of the content setting. |
32 void HandleUpdateOrigins(const base::ListValue* args); | 37 void HandleUpdateOrigins(const base::ListValue* args); |
33 | 38 |
34 // Update the page with all origins given a filter string. | 39 // Update the page with all origins given a filter string. |
35 // |args| is the filter string. | 40 // |args| is the filter string. |
36 void HandleUpdateSearchResults(const base::ListValue* args); | 41 void HandleUpdateSearchResults(const base::ListValue* args); |
37 | 42 |
43 // Update the page with all origins that are using local storage. | |
44 void HandleUpdateLocalStorage(const base::ListValue* args); | |
45 | |
46 // Callback method to be invoked when fetching the data is complete. | |
47 void OnLocalStorageFetched(const LocalStorageList& storage); | |
48 | |
38 // Get all origins with Content Settings for the last given content setting, | 49 // Get all origins with Content Settings for the last given content setting, |
39 // filter them by |filter|, and update the page. | 50 // filter them by |last_filter_|, and update the page. |
40 void UpdateOrigins(const std::string& filter); | 51 void UpdateOrigins(); |
41 | 52 |
42 ContentSettingsType last_setting_; | 53 // Get all origins with local storage usage, filter them by |last_filter_|, |
54 // and | |
Bernhard Bauer
2014/07/23 09:09:43
Un-break this line.
Daniel Nishi
2014/07/23 16:01:11
Done.
| |
55 // update the page. | |
56 void UpdateLocalStorage(); | |
57 | |
58 std::string last_setting_; | |
59 std::string last_filter_; | |
60 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_; | |
61 LocalStorageList local_storage_list_; | |
62 | |
63 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; | |
43 | 64 |
44 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); | 65 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); |
45 }; | 66 }; |
46 | 67 |
47 } // namespace options | 68 } // namespace options |
48 | 69 |
49 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ | 70 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ |
OLD | NEW |