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 module chrome.mojom; | 5 module chrome.mojom; |
| 6 | 6 |
| 7 // This mirrors the C++ type in | |
| 8 // 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.
| |
| 9 enum ContentSetting { | |
| 10 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.
| |
| 11 CONTENT_SETTING_ALLOW, | |
| 12 CONTENT_SETTING_BLOCK, | |
| 13 CONTENT_SETTING_ASK, | |
| 14 CONTENT_SETTING_SESSION_ONLY, | |
| 15 CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, | |
| 16 CONTENT_SETTING_NUM_SETTINGS | |
| 17 }; | |
| 18 | |
| 19 // This mirrors the C++ type in | |
| 20 // components/content_settings/core/common/content_settings.h | |
| 21 struct ContentSettingPatternSource { | |
| 22 // XXX: should we define above an explicit ContentSettingsPattern Mojo type | |
| 23 // for these two fields, instead of a string? Doing so is more code and a | |
| 24 // simpler string is possibly good enough. | |
| 25 // | |
| 26 // I suspect that the answer is, yes, you should define that extra machinery, | |
| 27 // but it'd be easier if the answer is no. | |
| 28 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.
| |
| 29 string secondary_pattern; | |
| 30 | |
| 31 ContentSetting setting; | |
| 32 string source; | |
| 33 bool incognito; | |
| 34 }; | |
| 35 | |
| 36 // This mirrors the C++ type in | |
| 37 // components/content_settings/core/common/content_settings.h | |
| 38 struct RendererContentSettingRules { | |
| 39 array<ContentSettingPatternSource> image_rules; | |
| 40 array<ContentSettingPatternSource> script_rules; | |
| 41 array<ContentSettingPatternSource> autoplay_rules; | |
| 42 }; | |
| 43 | |
| 7 // Configures the renderer. | 44 // Configures the renderer. |
| 8 interface RendererConfiguration { | 45 interface RendererConfiguration { |
| 9 // Configures the renderer, queued to send when the render process will | 46 // Configures the renderer, queued to send when the render process will |
| 10 // launch. | 47 // launch. |
| 11 // | |
| 12 // TODO(nigeltao): port the ChromeViewMsg_SetContentSettingRules legacy IPC | |
| 13 // message to be an additional arg here. | |
| 14 SetInitialConfiguration(bool is_incognito_process); | 48 SetInitialConfiguration(bool is_incognito_process); |
| 49 | |
| 50 // Set the content setting rules stored by the renderer. | |
| 51 SetContentSettingRules(RendererContentSettingRules rules); | |
| 15 }; | 52 }; |
| OLD | NEW |