Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Issue 2675483002: Replace PermissionType in chrome/ with ContentSettingsType (Closed)

Created:
3 years, 10 months ago by Timothy Loh
Modified:
3 years, 10 months ago
CC:
chromium-reviews, msramek+watch_chromium.org, mcasas+watch+vc_chromium.org, chfremer+watch_chromium.org, johnme+watch_chromium.org, markusheintz_, extensions-reviews_chromium.org, awdf+watch_chromium.org, toyoshim+midi_chromium.org, iclelland+watch_chromium.org, grt+watch_chromium.org, jam, chasej+watch_chromium.org, raymes+watch_chromium.org, jkarlin+watch_chromium.org, chromium-apps-reviews_chromium.org, harkness+watch_chromium.org, mlamouri+watch-notifications_chromium.org, dkrahn+watch_chromium.org, feature-media-reviews_chromium.org, oshima+watch_chromium.org, Michael van Ouwerkerk, mlamouri+watch-permissions_chromium.org, mlamouri+watch-geolocation_chromium.org, phoglund+watch_chromium.org, davemoore+watch_chromium.org, chrome-apps-syd-reviews_chromium.org, Devlin, xhwang, tommycli, Nathan Parker, tapted, Mattias Nissler (ping if slow), lfg, jsbell
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace PermissionType in chrome/ with ContentSettingsType This patch replaces most usages of PermissionType in chrome/ with ContentSettingsType. This reverts some of the past changes moving in the opposite direction, cleaning up the side-by-side enum storages of both PermissionType and ContentSettingsType in several classes, the main one being PermissionContextBase. Ideally we'd like PermissionManager to be the only class in chrome/ using PermissionType, but we may continue to use it in PermissionUmaUtil as the enum value is used directly in the ContentSettings.PermissionRequested histogram. This patch (re-)adds a CONTENT_SETTINGS_TYPE_PUSH_MESSAGING enum value. The enum is converted to the NOTIFICATION enum value in a few places (NotificationPermissionContext, PermissionContextBase and PermissionQueueController) so that it doesn't ever reach the HostContentSettingsMap. This is necessary for classes like NotificationPermissionContext to work correctly. We are hoping to further unify the logic of the push messaging and notification permissions in the future so as to not require a separate enum. Some PermissionType usages are left untouched for now as they need to handle PermissionType::MIDI. This permission is always set to true and doesn't currently have a corresponding ContentSettingsType enum value. A subsequent patch will add this value to ContentSettingsType. This patch should make it clear where the different enum types should be used and reduce the conversions between these types. BUG=689799 TBR=msramek,iclelland,devlin,xhwang,tommycli,nparker,tapted,mnissler,lfg,jsbell Review-Url: https://codereview.chromium.org/2675483002 Cr-Commit-Position: refs/heads/master@{#451574} Committed: https://chromium.googlesource.com/chromium/src/+/9a180ad9469617b9477a805f0676b1dbca15f395

Patch Set 1 #

Patch Set 2 : leave host_content_settings_map alone #

Patch Set 3 : ready #

Total comments: 29

Patch Set 4 : rebase #

Patch Set 5 : address review changes #

Patch Set 6 : rebase #

Total comments: 17

Patch Set 7 : rebase + address review comments #

Patch Set 8 : address more comments #

Patch Set 9 : fix up another comment #

Patch Set 10 : rebase #

Total comments: 4

Patch Set 11 : rebase + don't use WebsiteSettingsRegistry in RequestPermission #

Patch Set 12 : rebase #

Patch Set 13 : rebase better #

Patch Set 14 : rebase + include content_settings_types.h more #

Unified diffs Side-by-side diffs Delta from patch set Stats (+724 lines, -834 lines) Patch
M chrome/browser/background_sync/background_sync_permission_context.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +36 lines, -36 lines 0 comments Download
M chrome/browser/chromeos/attestation/platform_verification_flow.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/service_worker_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/geolocation/geolocation_infobar_delegate_android.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/media/midi_permission_context.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/media/midi_permission_infobar_delegate_android.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/media/protected_media_identifier_infobar_delegate_android.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/media/protected_media_identifier_permission_context.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/media/webrtc/media_permission.cc View 3 chunks +2 lines, -19 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context.h View 1 chunk +2 lines, -8 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +10 lines, -19 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_devices_controller.h View 2 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_devices_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +11 lines, -23 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/media/webrtc/media_stream_infobar_delegate_android.cc View 3 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/notifications/message_center_settings_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -10 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/notifications/notification_permission_infobar_delegate.h View 1 chunk +1 line, -5 lines 0 comments Download
M chrome/browser/notifications/notification_permission_infobar_delegate.cc View 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/notifications/notifier_state_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/notifications/platform_notification_service_impl.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/notifications/platform_notification_service_interactive_uitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/permissions/delegation_tracker.h View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/permissions/delegation_tracker.cc View 1 2 3 6 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/permissions/delegation_tracker_unittest.cc View 14 chunks +62 lines, -60 lines 0 comments Download
M chrome/browser/permissions/permission_blacklist_client.h View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/permissions/permission_blacklist_client.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/permissions/permission_context_base.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/permissions/permission_context_base.cc View 1 2 3 4 5 6 7 8 9 10 11 15 chunks +32 lines, -27 lines 0 comments Download
M chrome/browser/permissions/permission_context_base_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 26 chunks +48 lines, -95 lines 0 comments Download
M chrome/browser/permissions/permission_decision_auto_blocker.h View 5 chunks +9 lines, -10 lines 0 comments Download
M chrome/browser/permissions/permission_decision_auto_blocker.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +10 lines, -11 lines 0 comments Download
M chrome/browser/permissions/permission_decision_auto_blocker_unittest.cc View 1 2 3 4 5 6 7 8 9 20 chunks +83 lines, -85 lines 0 comments Download
M chrome/browser/permissions/permission_dialog_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/permissions/permission_dialog_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/permissions/permission_infobar_delegate.h View 4 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/permissions/permission_infobar_delegate.cc View 7 chunks +13 lines, -15 lines 0 comments Download
M chrome/browser/permissions/permission_manager.h View 1 2 3 4 4 chunks +19 lines, -8 lines 0 comments Download
M chrome/browser/permissions/permission_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 15 chunks +69 lines, -53 lines 0 comments Download
M chrome/browser/permissions/permission_queue_controller.h View 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/permissions/permission_queue_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +18 lines, -14 lines 0 comments Download
M chrome/browser/permissions/permission_queue_controller_unittest.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/permissions/permission_request.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/permissions/permission_request_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/permissions/permission_request_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +26 lines, -47 lines 0 comments Download
M chrome/browser/permissions/permission_request_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/permissions/permission_request_manager_test_api.h View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/permissions/permission_request_manager_test_api.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/permissions/permission_uma_util.h View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +17 lines, -15 lines 0 comments Download
M chrome/browser/permissions/permission_uma_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 chunks +58 lines, -55 lines 0 comments Download
M chrome/browser/permissions/permission_util.h View 1 2 3 4 5 6 7 8 1 chunk +15 lines, -17 lines 0 comments Download
M chrome/browser/permissions/permission_util.cc View 1 2 3 4 5 6 4 chunks +45 lines, -41 lines 0 comments Download
M chrome/browser/plugins/flash_download_interception.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/plugins/flash_permission_context.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/plugins/flash_temporary_permission_tracker_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/safe_browsing/permission_reporter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/permission_reporter.cc View 1 2 3 chunks +13 lines, -18 lines 0 comments Download
M chrome/browser/safe_browsing/permission_reporter_unittest.cc View 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/safe_browsing/ping_manager.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/storage/durable_storage_permission_context.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/website_settings/website_settings.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/website_settings/website_settings_ui.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/content_settings/core/common/content_settings_types.h View 1 2 3 4 5 6 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 90 (68 generated)
Timothy Loh
The added functions on PermissionManager are overloads with ContentSettingsType instead of PermissionType. I can rename ...
3 years, 10 months ago (2017-02-03 20:04:06 UTC) #31
dominickn
Thanks for this! I didn't spot anything too major, but I'll leave the bulk of ...
3 years, 10 months ago (2017-02-03 21:42:28 UTC) #34
Timothy Loh
https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/notifications/notification_permission_context.cc File chrome/browser/notifications/notification_permission_context.cc (right): https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/notifications/notification_permission_context.cc#newcode183 chrome/browser/notifications/notification_permission_context.cc:183: return HostContentSettingsMapFactory::GetForProfile(profile()) On 2017/02/03 21:42:28, dominickn wrote: > What ...
3 years, 10 months ago (2017-02-03 22:14:14 UTC) #35
raymes
Thanks Tim! This is great. Please file a new bug for this. I closed 563677. ...
3 years, 10 months ago (2017-02-07 04:46:15 UTC) #36
raymes
https://codereview.chromium.org/2675483002/diff/100001/components/content_settings/core/common/content_settings_types.h File components/content_settings/core/common/content_settings_types.h (right): https://codereview.chromium.org/2675483002/diff/100001/components/content_settings/core/common/content_settings_types.h#newcode53 components/content_settings/core/common/content_settings_types.h:53: // it with notifications. On 2017/02/07 04:46:15, raymes wrote: ...
3 years, 10 months ago (2017-02-07 04:50:55 UTC) #37
Timothy Loh
https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/permissions/permission_context_base.cc File chrome/browser/permissions/permission_context_base.cc (right): https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/permissions/permission_context_base.cc#newcode120 chrome/browser/permissions/permission_context_base.cc:120: requesting_origin, embedding_origin, type_for_map); On 2017/02/07 04:46:15, raymes wrote: > ...
3 years, 10 months ago (2017-02-08 04:01:07 UTC) #39
raymes
lg with a few more minor comments. Thanks! https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/permissions/permission_context_base.cc File chrome/browser/permissions/permission_context_base.cc (right): https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/permissions/permission_context_base.cc#newcode120 chrome/browser/permissions/permission_context_base.cc:120: requesting_origin, ...
3 years, 10 months ago (2017-02-09 00:39:57 UTC) #44
Timothy Loh
Latest patch set should have all comments addressed :) https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/permissions/permission_context_base.cc File chrome/browser/permissions/permission_context_base.cc (right): https://codereview.chromium.org/2675483002/diff/100001/chrome/browser/permissions/permission_context_base.cc#newcode120 chrome/browser/permissions/permission_context_base.cc:120: ...
3 years, 10 months ago (2017-02-10 07:25:38 UTC) #51
Timothy Loh
+peter@chromium.org: FYI, I'm re-adding the push messaging ContentSettingsType enum value in this patch, and we'll ...
3 years, 10 months ago (2017-02-10 07:58:37 UTC) #57
Peter Beverloo
This strikes me as rather fragile - the sort of bugs that I can imagine ...
3 years, 10 months ago (2017-02-10 16:22:52 UTC) #60
Timothy Loh
I spent a bit more time clicking around in code search and as best I ...
3 years, 10 months ago (2017-02-13 04:08:36 UTC) #63
raymes
On 2017/02/10 16:22:52, Peter Beverloo wrote: > This strikes me as rather fragile - the ...
3 years, 10 months ago (2017-02-13 05:54:44 UTC) #66
Peter Beverloo
On 2017/02/13 05:54:44, raymes wrote: > On 2017/02/10 16:22:52, Peter Beverloo wrote: > > This ...
3 years, 10 months ago (2017-02-13 13:57:51 UTC) #67
raymes
On 2017/02/13 13:57:51, Peter Beverloo wrote: > On 2017/02/13 05:54:44, raymes wrote: > > On ...
3 years, 10 months ago (2017-02-14 00:23:11 UTC) #68
raymes
lgtm
3 years, 10 months ago (2017-02-14 00:40:00 UTC) #69
Timothy Loh
On 2017/02/13 13:57:51, Peter Beverloo wrote: > We can mitigate a lot of my concerns ...
3 years, 10 months ago (2017-02-17 00:30:26 UTC) #78
Peter Beverloo
lgtm, thank you for the additional fixes! This is missing includes to content_settings_types.h pretty much ...
3 years, 10 months ago (2017-02-17 12:39:10 UTC) #79
Timothy Loh
On 2017/02/17 12:39:10, Peter Beverloo wrote: > This is missing includes to content_settings_types.h pretty much ...
3 years, 10 months ago (2017-02-20 06:05:01 UTC) #80
Timothy Loh
TBRing various people for OWNERS. This patch is changing the enums we use for permissions ...
3 years, 10 months ago (2017-02-20 06:18:45 UTC) #82
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2675483002/320001
3 years, 10 months ago (2017-02-20 06:19:12 UTC) #85
commit-bot: I haz the power
Committed patchset #14 (id:320001) as https://chromium.googlesource.com/chromium/src/+/9a180ad9469617b9477a805f0676b1dbca15f395
3 years, 10 months ago (2017-02-20 07:16:53 UTC) #88
tapted
3 years, 10 months ago (2017-02-20 08:40:10 UTC) #90
Message was sent while issue was closed.
chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa_interactive_uitest.mm
lgtm

Powered by Google App Engine
This is Rietveld 408576698