Raymes has written a doc proposing various refactorings in the permissions code: https://docs.google.com/document/d/1F2SXlanlqHFobtCsXpGZBUXu22Df5hB0EKGmrfmNsio/edit#
There are several problems described in the doc:
The first is the state of the PermissionType/ContentSettingsType and PermissionStatus/ContentSetting enums. We would like to use only the latter types within chrome/, converting from the content/ types at the content/ boundary. This will require adding extra values (MIDI, PUSH_MESSAGING) to the ContentSettingsType enum, but will allow us to clean up classes storing both enum types, and make it obvious which type to use where.
The second is about code accessing the HostContentSettingsMap directly instead of via the PermissionsManager. We want to ensure that code querying permission information is using the PermissionsManager as much as possible.
The third is about permission logic in content_settings. We would like to move all permission logic in components/content_settings into chrome/browser/permissions.
Comment 1 by bugdroid1@chromium.org
, Feb 20 2017