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 <string> |
| 11 #include <utility> |
10 #include <vector> | 12 #include <vector> |
11 | 13 |
12 #include "components/content_settings/core/common/content_settings.h" | 14 #include "components/content_settings/core/common/content_settings.h" |
13 #include "components/content_settings/core/common/content_settings_pattern.h" | 15 #include "components/content_settings/core/common/content_settings_pattern.h" |
14 #include "components/content_settings/core/common/content_settings_types.h" | 16 #include "components/content_settings/core/common/content_settings_types.h" |
15 #include "content/public/browser/web_ui.h" | 17 #include "content/public/browser/web_ui.h" |
16 | 18 |
17 class ChooserContextBase; | 19 class ChooserContextBase; |
18 class HostContentSettingsMap; | 20 class HostContentSettingsMap; |
19 class Profile; | 21 class Profile; |
(...skipping 27 matching lines...) Expand all Loading... |
47 // Returns whether a group name has been registered for the given type. | 49 // Returns whether a group name has been registered for the given type. |
48 bool HasRegisteredGroupName(ContentSettingsType type); | 50 bool HasRegisteredGroupName(ContentSettingsType type); |
49 | 51 |
50 // Gets a content settings type from the group name identifier. | 52 // Gets a content settings type from the group name identifier. |
51 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name); | 53 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name); |
52 | 54 |
53 // Gets a string identifier for the group name. | 55 // Gets a string identifier for the group name. |
54 std::string ContentSettingsTypeToGroupName(ContentSettingsType type); | 56 std::string ContentSettingsTypeToGroupName(ContentSettingsType type); |
55 | 57 |
56 // Fills in |exceptions| with Values for the given |type| from |map|. | 58 // Fills in |exceptions| with Values for the given |type| from |map|. |
| 59 // If |filter| is not null then only exceptions with matching primary patterns |
| 60 // will be returned. |
57 void GetExceptionsFromHostContentSettingsMap( | 61 void GetExceptionsFromHostContentSettingsMap( |
58 const HostContentSettingsMap* map, | 62 const HostContentSettingsMap* map, |
59 ContentSettingsType type, | 63 ContentSettingsType type, |
60 content::WebUI* web_ui, | 64 content::WebUI* web_ui, |
61 bool incognito, | 65 bool incognito, |
| 66 const std::string* filter, |
62 base::ListValue* exceptions); | 67 base::ListValue* exceptions); |
63 | 68 |
64 // Returns exceptions constructed from the policy-set allowed URLs | 69 // Returns exceptions constructed from the policy-set allowed URLs |
65 // for the content settings |type| mic or camera. | 70 // for the content settings |type| mic or camera. |
66 void GetPolicyAllowedUrls( | 71 void GetPolicyAllowedUrls( |
67 ContentSettingsType type, | 72 ContentSettingsType type, |
68 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, | 73 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, |
69 content::WebUI* web_ui, | 74 content::WebUI* web_ui, |
70 bool incognito); | 75 bool incognito); |
71 | 76 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Fills in |exceptions| with Values for the given |chooser_type| from map. | 126 // Fills in |exceptions| with Values for the given |chooser_type| from map. |
122 void GetChooserExceptionsFromProfile( | 127 void GetChooserExceptionsFromProfile( |
123 Profile* profile, | 128 Profile* profile, |
124 bool incognito, | 129 bool incognito, |
125 const ChooserTypeNameEntry& chooser_type, | 130 const ChooserTypeNameEntry& chooser_type, |
126 base::ListValue* exceptions); | 131 base::ListValue* exceptions); |
127 | 132 |
128 } // namespace site_settings | 133 } // namespace site_settings |
129 | 134 |
130 #endif // CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ | 135 #endif // CHROME_BROWSER_UI_WEBUI_SITE_SETTINGS_HELPER_H_ |
OLD | NEW |