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 |
24 // OptionsPageUIHandler implementation. | 26 // OptionsPageUIHandler implementation. |
25 virtual void GetLocalizedValues( | 27 virtual void GetLocalizedValues( |
26 base::DictionaryValue* localized_strings) OVERRIDE; | 28 base::DictionaryValue* localized_strings) OVERRIDE; |
27 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() OVERRIDE; |
28 | 30 |
29 private: | 31 private: |
30 // Update the page with all origins for a given content setting. | 32 // Update the page with all origins for a given content setting. |
31 // |args| is the string name of the content setting. | 33 // |args| is the string name of the content setting. |
32 void HandleUpdateOrigins(const base::ListValue* args); | 34 void HandleUpdateOrigins(const base::ListValue* args); |
33 | 35 |
34 // Update the page with all origins given a filter string. | 36 // Update the page with all origins given a filter string. |
35 // |args| is the filter string. | 37 // |args| is the filter string. |
36 void HandleUpdateSearchResults(const base::ListValue* args); | 38 void HandleUpdateSearchResults(const base::ListValue* args); |
37 | 39 |
40 // Update the page with all origins that are using local storage. | |
41 void HandleUpdateLocalStorage(const base::ListValue* args); | |
42 | |
43 // Callback method to be invoked when fetching the data is complete. | |
44 void OnLocalStorageFetch( | |
Bernhard Bauer
2014/07/21 11:29:30
Nit: OnLocalStoragedFetched?
Daniel Nishi
2014/07/21 17:53:37
Done.
| |
45 const std::string& filter, | |
46 const std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo>& | |
47 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 |filter|, and update the page. |
40 void UpdateOrigins(const std::string& filter); | 51 void UpdateOrigins(const std::string& filter); |
41 | 52 |
42 ContentSettingsType last_setting_; | 53 // Get all origins with local storage usage, filter them by |filter|, and |
54 // update the page. | |
55 void UpdateLocalStorage(const std::string& filter); | |
56 | |
57 std::string last_setting_; | |
58 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_; | |
43 | 59 |
44 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); | 60 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); |
45 }; | 61 }; |
46 | 62 |
47 } // namespace options | 63 } // namespace options |
48 | 64 |
49 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ | 65 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ |
OLD | NEW |