| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name); | 51 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name); |
| 52 | 52 |
| 53 // Gets a string identifier for the group name. | 53 // Gets a string identifier for the group name. |
| 54 std::string ContentSettingsTypeToGroupName(ContentSettingsType type); | 54 std::string ContentSettingsTypeToGroupName(ContentSettingsType type); |
| 55 | 55 |
| 56 // Fills in |exceptions| with Values for the given |type| from |map|. | 56 // Fills in |exceptions| with Values for the given |type| from |map|. |
| 57 void GetExceptionsFromHostContentSettingsMap( | 57 void GetExceptionsFromHostContentSettingsMap( |
| 58 const HostContentSettingsMap* map, | 58 const HostContentSettingsMap* map, |
| 59 ContentSettingsType type, | 59 ContentSettingsType type, |
| 60 content::WebUI* web_ui, | 60 content::WebUI* web_ui, |
| 61 bool incognito, |
| 61 base::ListValue* exceptions); | 62 base::ListValue* exceptions); |
| 62 | 63 |
| 63 // Returns exceptions constructed from the policy-set allowed URLs | 64 // Returns exceptions constructed from the policy-set allowed URLs |
| 64 // for the content settings |type| mic or camera. | 65 // for the content settings |type| mic or camera. |
| 65 void GetPolicyAllowedUrls( | 66 void GetPolicyAllowedUrls( |
| 66 ContentSettingsType type, | 67 ContentSettingsType type, |
| 67 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, | 68 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, |
| 68 content::WebUI* web_ui); | 69 content::WebUI* web_ui, |
| 70 bool incognito); |
| 69 | 71 |
| 70 // This struct facilitates lookup of a chooser context factory function by name | 72 // This struct facilitates lookup of a chooser context factory function by name |
| 71 // for a given content settings type and is declared early so that it can used | 73 // for a given content settings type and is declared early so that it can used |
| 72 // by functions below. | 74 // by functions below. |
| 73 struct ChooserTypeNameEntry { | 75 struct ChooserTypeNameEntry { |
| 74 ContentSettingsType type; | 76 ContentSettingsType type; |
| 75 ChooserContextBase* (*get_context)(Profile*); | 77 ChooserContextBase* (*get_context)(Profile*); |
| 76 const char* name; | 78 const char* name; |
| 77 const char* ui_name_key; | 79 const char* ui_name_key; |
| 78 }; | 80 }; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Fills in |exceptions| with Values for the given |chooser_type| from map. | 121 // Fills in |exceptions| with Values for the given |chooser_type| from map. |
| 120 void GetChooserExceptionsFromProfile( | 122 void GetChooserExceptionsFromProfile( |
| 121 Profile* profile, | 123 Profile* profile, |
| 122 bool incognito, | 124 bool incognito, |
| 123 const ChooserTypeNameEntry& chooser_type, | 125 const ChooserTypeNameEntry& chooser_type, |
| 124 base::ListValue* exceptions); | 126 base::ListValue* exceptions); |
| 125 | 127 |
| 126 } // namespace site_settings | 128 } // namespace site_settings |
| 127 | 129 |
| 128 #endif // CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ | 130 #endif // CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ |
| OLD | NEW |