| 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" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Update the page with all origins for a given content setting. | 44 // Update the page with all origins for a given content setting. |
| 45 // |args| is the string name of the content setting. | 45 // |args| is the string name of the content setting. |
| 46 void HandleUpdateOrigins(const base::ListValue* args); | 46 void HandleUpdateOrigins(const base::ListValue* args); |
| 47 | 47 |
| 48 // Update the page with all origins given a filter string. | 48 // Update the page with all origins given a filter string. |
| 49 // |args| is the filter string. | 49 // |args| is the filter string. |
| 50 void HandleUpdateSearchResults(const base::ListValue* args); | 50 void HandleUpdateSearchResults(const base::ListValue* args); |
| 51 | 51 |
| 52 // Update the single site edit view with the permission values for a given |
| 53 // url, if the url is valid. |
| 54 // |args| is the URL. |
| 55 void HandleGetOriginInfo(const base::ListValue* args); |
| 56 |
| 57 // Sets the content setting permissions for a given setting type for the last |
| 58 // used origin. |
| 59 // |args| is the name of the setting and the new value. |
| 60 void HandleSetOriginPermission(const base::ListValue* args); |
| 61 |
| 52 // Update the page with all origins that are using local storage. | 62 // Update the page with all origins that are using local storage. |
| 53 void HandleUpdateLocalStorage(const base::ListValue* args); | 63 void HandleUpdateLocalStorage(const base::ListValue* args); |
| 54 | 64 |
| 65 // Show the single site edit view if the given URL is valid. |
| 66 // |args| is the URL. |
| 67 void HandleMaybeShowEditPage(const base::ListValue* args); |
| 68 |
| 55 // Callback method to be invoked when fetching the data is complete. | 69 // Callback method to be invoked when fetching the data is complete. |
| 56 void OnLocalStorageFetched(const LocalStorageList& storage); | 70 void OnLocalStorageFetched(const LocalStorageList& storage); |
| 57 | 71 |
| 58 // Get all origins with Content Settings for the last given content setting, | 72 // Get all origins with Content Settings for the last given content setting, |
| 59 // filter them by |last_filter_|, and update the page. | 73 // filter them by |last_filter_|, and update the page. |
| 60 void UpdateOrigins(); | 74 void UpdateOrigins(); |
| 61 | 75 |
| 62 // Get all origins with local storage usage, filter them by |last_filter_|, | 76 // Get all origins with local storage usage, filter them by |last_filter_|, |
| 63 // and update the page. | 77 // and update the page. |
| 64 void UpdateLocalStorage(); | 78 void UpdateLocalStorage(); |
| 65 | 79 |
| 80 // Populates the single site edit view with the permissions and local storage |
| 81 // usage for a given |site_url|. |
| 82 void GetInfoForOrigin(const GURL& site_url); |
| 83 |
| 66 // Updates the page with the last settings used. | 84 // Updates the page with the last settings used. |
| 67 void Update(); | 85 void Update(); |
| 68 | 86 |
| 69 std::string last_setting_; | 87 std::string last_setting_; |
| 70 std::string last_filter_; | 88 std::string last_filter_; |
| 89 GURL last_site_; |
| 71 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_; | 90 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_; |
| 72 LocalStorageList local_storage_list_; | 91 LocalStorageList local_storage_list_; |
| 73 | 92 |
| 74 // Observer to watch for content settings changes. | 93 // Observer to watch for content settings changes. |
| 75 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 94 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 76 | 95 |
| 77 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; | 96 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; |
| 78 | 97 |
| 79 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); | 98 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); |
| 80 }; | 99 }; |
| 81 | 100 |
| 82 } // namespace options | 101 } // namespace options |
| 83 | 102 |
| 84 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ | 103 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ |
| OLD | NEW |