Chromium Code Reviews| Index: chrome/common/renderer_configuration.mojom |
| diff --git a/chrome/common/renderer_configuration.mojom b/chrome/common/renderer_configuration.mojom |
| index b04f1bcc8489a5ea79bfed22ba900d5aa110af01..37bb5306163e1cc41167bd1625c761a18a67334f 100644 |
| --- a/chrome/common/renderer_configuration.mojom |
| +++ b/chrome/common/renderer_configuration.mojom |
| @@ -4,12 +4,49 @@ |
| module chrome.mojom; |
| +// This mirrors the C++ type in |
| +// components/content_settings/core/common/content_settings.h |
|
Sam McNally
2016/12/19 00:17:51
I think these structs/enums should live in compone
nigeltao1
2016/12/22 04:09:45
Done.
|
| +enum ContentSetting { |
| + CONTENT_SETTING_DEFAULT = 0, |
|
Sam McNally
2016/12/19 00:17:51
Mojo enums generate scoped enums in C++ so you don
nigeltao1
2016/12/22 04:09:45
Done.
|
| + CONTENT_SETTING_ALLOW, |
| + CONTENT_SETTING_BLOCK, |
| + CONTENT_SETTING_ASK, |
| + CONTENT_SETTING_SESSION_ONLY, |
| + CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, |
| + CONTENT_SETTING_NUM_SETTINGS |
| +}; |
| + |
| +// This mirrors the C++ type in |
| +// components/content_settings/core/common/content_settings.h |
| +struct ContentSettingPatternSource { |
| + // XXX: should we define above an explicit ContentSettingsPattern Mojo type |
| + // for these two fields, instead of a string? Doing so is more code and a |
| + // simpler string is possibly good enough. |
| + // |
| + // I suspect that the answer is, yes, you should define that extra machinery, |
| + // but it'd be easier if the answer is no. |
| + string primary_pattern; |
|
Sam McNally
2016/12/19 00:17:51
I think a struct would be preferred.
nigeltao1
2016/12/22 04:09:45
Done.
|
| + string secondary_pattern; |
| + |
| + ContentSetting setting; |
| + string source; |
| + bool incognito; |
| +}; |
| + |
| +// This mirrors the C++ type in |
| +// components/content_settings/core/common/content_settings.h |
| +struct RendererContentSettingRules { |
| + array<ContentSettingPatternSource> image_rules; |
| + array<ContentSettingPatternSource> script_rules; |
| + array<ContentSettingPatternSource> autoplay_rules; |
| +}; |
| + |
| // Configures the renderer. |
| interface RendererConfiguration { |
| // Configures the renderer, queued to send when the render process will |
| // launch. |
| - // |
| - // TODO(nigeltao): port the ChromeViewMsg_SetContentSettingRules legacy IPC |
| - // message to be an additional arg here. |
| SetInitialConfiguration(bool is_incognito_process); |
| + |
| + // Set the content setting rules stored by the renderer. |
| + SetContentSettingRules(RendererContentSettingRules rules); |
| }; |