| 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_SITE_SETTINGS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 OnePatternSettings> | 32 OnePatternSettings> |
| 33 AllPatternsSettings; | 33 AllPatternsSettings; |
| 34 | 34 |
| 35 extern const char kSetting[]; | 35 extern const char kSetting[]; |
| 36 extern const char kOrigin[]; | 36 extern const char kOrigin[]; |
| 37 extern const char kPolicyProviderId[]; | 37 extern const char kPolicyProviderId[]; |
| 38 extern const char kSource[]; | 38 extern const char kSource[]; |
| 39 extern const char kEmbeddingOrigin[]; | 39 extern const char kEmbeddingOrigin[]; |
| 40 extern const char kPreferencesSource[]; | 40 extern const char kPreferencesSource[]; |
| 41 | 41 |
| 42 // Returns whether a group name has been registered for the given type. |
| 43 bool HasRegisteredGroupName(ContentSettingsType type); |
| 44 |
| 42 // Gets a content settings type from the group name identifier. | 45 // Gets a content settings type from the group name identifier. |
| 43 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name); | 46 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name); |
| 44 | 47 |
| 45 // Gets a string identifier for the group name. | 48 // Gets a string identifier for the group name. |
| 46 std::string ContentSettingsTypeToGroupName(ContentSettingsType type); | 49 std::string ContentSettingsTypeToGroupName(ContentSettingsType type); |
| 47 | 50 |
| 48 // Fills in |exceptions| with Values for the given |type| from |map|. | 51 // Fills in |exceptions| with Values for the given |type| from |map|. |
| 49 void GetExceptionsFromHostContentSettingsMap( | 52 void GetExceptionsFromHostContentSettingsMap( |
| 50 const HostContentSettingsMap* map, | 53 const HostContentSettingsMap* map, |
| 51 ContentSettingsType type, | 54 ContentSettingsType type, |
| 52 content::WebUI* web_ui, | 55 content::WebUI* web_ui, |
| 53 base::ListValue* exceptions); | 56 base::ListValue* exceptions); |
| 54 | 57 |
| 55 // Returns exceptions constructed from the policy-set allowed URLs | 58 // Returns exceptions constructed from the policy-set allowed URLs |
| 56 // for the content settings |type| mic or camera. | 59 // for the content settings |type| mic or camera. |
| 57 void GetPolicyAllowedUrls( | 60 void GetPolicyAllowedUrls( |
| 58 ContentSettingsType type, | 61 ContentSettingsType type, |
| 59 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, | 62 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, |
| 60 content::WebUI* web_ui); | 63 content::WebUI* web_ui); |
| 61 | 64 |
| 62 } // namespace site_settings | 65 } // namespace site_settings |
| 63 | 66 |
| 64 #endif // CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ | 67 #endif // CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ |
| OLD | NEW |