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 "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
13 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 13 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
14 #include "chrome/browser/content_settings/host_content_settings_map.h" | 14 #include "chrome/browser/content_settings/host_content_settings_map.h" |
15 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
16 #include "components/content_settings/core/browser/content_settings_observer.h" | 16 #include "components/content_settings/core/browser/content_settings_observer.h" |
17 #include "components/power/origin_power_map.h" | 17 #include "components/power/origin_power_map.h" |
18 | 18 |
19 namespace options { | 19 namespace options { |
20 | 20 |
21 class WebsiteSettingsHandler : public content_settings::Observer, | 21 class WebsiteSettingsHandler : public content_settings::Observer, |
22 public OptionsPageUIHandler { | 22 public OptionsPageUIHandler { |
23 public: | 23 public: |
24 WebsiteSettingsHandler(); | 24 WebsiteSettingsHandler(); |
25 virtual ~WebsiteSettingsHandler(); | 25 ~WebsiteSettingsHandler() override; |
26 | 26 |
27 typedef std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> | 27 typedef std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo> |
28 LocalStorageList; | 28 LocalStorageList; |
29 | 29 |
30 // OptionsPageUIHandler implementation. | 30 // OptionsPageUIHandler implementation. |
31 virtual void GetLocalizedValues( | 31 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
32 base::DictionaryValue* localized_strings) override; | 32 void InitializeHandler() override; |
33 virtual void InitializeHandler() override; | 33 void RegisterMessages() override; |
34 virtual void RegisterMessages() override; | |
35 | 34 |
36 // content_settings::Observer implementation. | 35 // content_settings::Observer implementation. |
37 virtual void OnContentSettingChanged( | 36 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
38 const ContentSettingsPattern& primary_pattern, | 37 const ContentSettingsPattern& secondary_pattern, |
39 const ContentSettingsPattern& secondary_pattern, | 38 ContentSettingsType content_type, |
40 ContentSettingsType content_type, | 39 std::string resource_identifier) override; |
41 std::string resource_identifier) override; | 40 void OnContentSettingUsed(const ContentSettingsPattern& primary_pattern, |
42 virtual void OnContentSettingUsed( | 41 const ContentSettingsPattern& secondary_pattern, |
43 const ContentSettingsPattern& primary_pattern, | 42 ContentSettingsType content_type) override; |
44 const ContentSettingsPattern& secondary_pattern, | |
45 ContentSettingsType content_type) override; | |
46 | 43 |
47 private: | 44 private: |
48 // Update the page with all origins for a given content setting. | 45 // Update the page with all origins for a given content setting. |
49 // |args| is the string name of the content setting. | 46 // |args| is the string name of the content setting. |
50 void HandleUpdateOrigins(const base::ListValue* args); | 47 void HandleUpdateOrigins(const base::ListValue* args); |
51 | 48 |
52 // Update the page with all origins given a filter string. | 49 // Update the page with all origins given a filter string. |
53 // |args| is the filter string. | 50 // |args| is the filter string. |
54 void HandleUpdateSearchResults(const base::ListValue* args); | 51 void HandleUpdateSearchResults(const base::ListValue* args); |
55 | 52 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 scoped_ptr<power::OriginPowerMap::Subscription> subscription_; | 139 scoped_ptr<power::OriginPowerMap::Subscription> subscription_; |
143 | 140 |
144 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; | 141 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; |
145 | 142 |
146 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); | 143 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); |
147 }; | 144 }; |
148 | 145 |
149 } // namespace options | 146 } // namespace options |
150 | 147 |
151 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ | 148 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ |
OLD | NEW |