| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SETTINGS_SITE_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 void OnUsageInfoCleared(storage::QuotaStatusCode code); | 35 void OnUsageInfoCleared(storage::QuotaStatusCode code); |
| 36 | 36 |
| 37 // content_settings::Observer: | 37 // content_settings::Observer: |
| 38 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, | 38 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
| 39 const ContentSettingsPattern& secondary_pattern, | 39 const ContentSettingsPattern& secondary_pattern, |
| 40 ContentSettingsType content_type, | 40 ContentSettingsType content_type, |
| 41 std::string resource_identifier) override; | 41 std::string resource_identifier) override; |
| 42 private: | 42 private: |
| 43 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetDefault); | 43 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetDefault); |
| 44 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins); | 44 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins); |
| 45 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Patterns); |
| 45 | 46 |
| 46 // Asynchronously fetches the usage for a given origin. Replies back with | 47 // Asynchronously fetches the usage for a given origin. Replies back with |
| 47 // OnGetUsageInfo above. | 48 // OnGetUsageInfo above. |
| 48 void HandleFetchUsageTotal(const base::ListValue* args); | 49 void HandleFetchUsageTotal(const base::ListValue* args); |
| 49 | 50 |
| 50 // Deletes the storage being used for a given host. | 51 // Deletes the storage being used for a given host. |
| 51 void HandleClearUsage(const base::ListValue* args); | 52 void HandleClearUsage(const base::ListValue* args); |
| 52 | 53 |
| 53 // Gets and sets the default value for a particular content settings type. | 54 // Gets and sets the default value for a particular content settings type. |
| 54 void HandleSetDefaultValueForContentType(const base::ListValue* args); | 55 void HandleSetDefaultValueForContentType(const base::ListValue* args); |
| 55 void HandleGetDefaultValueForContentType(const base::ListValue* args); | 56 void HandleGetDefaultValueForContentType(const base::ListValue* args); |
| 56 | 57 |
| 57 // Returns the list of site exceptions for a given content settings type; | 58 // Returns the list of site exceptions for a given content settings type. |
| 58 void HandleGetExceptionList(const base::ListValue* args); | 59 void HandleGetExceptionList(const base::ListValue* args); |
| 59 | 60 |
| 60 // Handles setting and resetting of an origin permission; | 61 // Handles setting and resetting of an origin permission. |
| 61 void HandleResetCategoryPermissionForOrigin(const base::ListValue* args); | 62 void HandleResetCategoryPermissionForOrigin(const base::ListValue* args); |
| 62 void HandleSetCategoryPermissionForOrigin(const base::ListValue* args); | 63 void HandleSetCategoryPermissionForOrigin(const base::ListValue* args); |
| 63 | 64 |
| 65 // Returns whether a given pattern is valid. |
| 66 void HandleIsPatternValid(const base::ListValue* args); |
| 67 |
| 64 Profile* profile_; | 68 Profile* profile_; |
| 65 | 69 |
| 66 // The host for which to fetch usage. | 70 // The host for which to fetch usage. |
| 67 std::string usage_host_; | 71 std::string usage_host_; |
| 68 | 72 |
| 69 // The origin for which to clear usage. | 73 // The origin for which to clear usage. |
| 70 std::string clearing_origin_; | 74 std::string clearing_origin_; |
| 71 | 75 |
| 72 // Change observer for content settings. | 76 // Change observer for content settings. |
| 73 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 77 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 74 | 78 |
| 75 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler); | 79 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler); |
| 76 }; | 80 }; |
| 77 | 81 |
| 78 } // namespace settings | 82 } // namespace settings |
| 79 | 83 |
| 80 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ | 84 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ |
| OLD | NEW |