Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 public content_settings::Observer { | 26 public content_settings::Observer { |
| 27 public: | 27 public: |
| 28 explicit SiteSettingsHandler(Profile* profile); | 28 explicit SiteSettingsHandler(Profile* profile); |
| 29 ~SiteSettingsHandler() override; | 29 ~SiteSettingsHandler() override; |
| 30 | 30 |
| 31 // SettingsPageUIHandler: | 31 // SettingsPageUIHandler: |
| 32 void RegisterMessages() override; | 32 void RegisterMessages() override; |
| 33 void OnJavascriptAllowed() override; | 33 void OnJavascriptAllowed() override; |
| 34 void OnJavascriptDisallowed() override; | 34 void OnJavascriptDisallowed() override; |
| 35 | 35 |
| 36 // Usage info: | |
|
dschuyler
2016/08/12 20:58:48
nit: it's an oddity that some comments end with ':
Finnur
2016/08/15 11:54:33
Done.
| |
| 36 void OnGetUsageInfo(const storage::UsageInfoEntries& entries); | 37 void OnGetUsageInfo(const storage::UsageInfoEntries& entries); |
| 37 void OnUsageInfoCleared(storage::QuotaStatusCode code); | 38 void OnUsageInfoCleared(storage::QuotaStatusCode code); |
| 38 | 39 |
| 39 // content_settings::Observer: | 40 // content_settings::Observer: |
| 40 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, | 41 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
| 41 const ContentSettingsPattern& secondary_pattern, | 42 const ContentSettingsPattern& secondary_pattern, |
| 42 ContentSettingsType content_type, | 43 ContentSettingsType content_type, |
| 43 std::string resource_identifier) override; | 44 std::string resource_identifier) override; |
| 44 private: | 45 private: |
| 45 friend class SiteSettingsHandlerTest; | 46 friend class SiteSettingsHandlerTest; |
| 46 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetDefault); | 47 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetDefault); |
| 47 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins); | 48 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins); |
| 48 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Patterns); | 49 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Patterns); |
| 49 | 50 |
| 50 // Asynchronously fetches the usage for a given origin. Replies back with | 51 // Asynchronously fetches the usage for a given origin. Replies back with |
| 51 // OnGetUsageInfo above. | 52 // OnGetUsageInfo above. |
| 52 void HandleFetchUsageTotal(const base::ListValue* args); | 53 void HandleFetchUsageTotal(const base::ListValue* args); |
| 53 | 54 |
| 54 // Deletes the storage being used for a given host. | 55 // Deletes the storage being used for a given host. |
| 55 void HandleClearUsage(const base::ListValue* args); | 56 void HandleClearUsage(const base::ListValue* args); |
| 56 | 57 |
| 58 // Handles the request for a list of all USB devices. | |
| 59 void HandleFetchUsbDevices(const base::ListValue* args); | |
| 60 | |
| 61 // Removes a particular USB device permission. | |
| 62 void HandleRemoveUsbDevice(const base::ListValue* args); | |
| 63 | |
| 57 // Gets and sets the default value for a particular content settings type. | 64 // Gets and sets the default value for a particular content settings type. |
| 58 void HandleSetDefaultValueForContentType(const base::ListValue* args); | 65 void HandleSetDefaultValueForContentType(const base::ListValue* args); |
| 59 void HandleGetDefaultValueForContentType(const base::ListValue* args); | 66 void HandleGetDefaultValueForContentType(const base::ListValue* args); |
| 60 | 67 |
| 61 // Returns the list of site exceptions for a given content settings type. | 68 // Returns the list of site exceptions for a given content settings type. |
| 62 void HandleGetExceptionList(const base::ListValue* args); | 69 void HandleGetExceptionList(const base::ListValue* args); |
| 63 | 70 |
| 64 // Handles setting and resetting of an origin permission. | 71 // Handles setting and resetting of an origin permission. |
| 65 void HandleResetCategoryPermissionForOrigin(const base::ListValue* args); | 72 void HandleResetCategoryPermissionForOrigin(const base::ListValue* args); |
| 66 void HandleSetCategoryPermissionForOrigin(const base::ListValue* args); | 73 void HandleSetCategoryPermissionForOrigin(const base::ListValue* args); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 78 | 85 |
| 79 // Change observer for content settings. | 86 // Change observer for content settings. |
| 80 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 87 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 81 | 88 |
| 82 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler); | 89 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler); |
| 83 }; | 90 }; |
| 84 | 91 |
| 85 } // namespace settings | 92 } // namespace settings |
| 86 | 93 |
| 87 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ | 94 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ |
| OLD | NEW |