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

Issue 2149883002: Use the same codepath for NOTIFICATIONS and PUSH_MESSAGING permissions (Closed)

Created:
4 years, 5 months ago by raymes
Modified:
4 years, 5 months ago
CC:
chromium-reviews, mlamouri+watch-permissions_chromium.org, Peter Beverloo, mlamouri+watch-notifications_chromium.org, harkness+watch_chromium.org, johnme+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use the same codepath for NOTIFICATIONS and PUSH_MESSAGING permissions We used to have a complicated dependency between the notifications and push messaging permissions and content settings. The push messaging content setting will no longer be used (the setting will be deleted in a follow up CL). Since the permissions are essentially the same now, we reuse the same PermissionContext class for both, with some very slight behavioral differences for push messaging. Behaviorally, this change will mean that if a user happened to have CONTENT_SETTINGS_TYPE_PUSH_MESSAGING set to block for a particular origin, they will fall back to their CONTENT_SETTINGS_TYPE_NOTIFICATIONS setting for that origin. Note that it's very unlikely that any users do have CONTENT_SETTINGS_TYPE_PUSH_MESSAGING set, as it seems like this setting was never actually exposed to users on stable. More details can be found here: https://docs.google.com/document/d/1-Vny4paBx6gFZuCeLX2Gq9ztkF-JhNYM_uqvrQDj-6M/edit#heading=h.h99sppup43dn BUG=628058 Committed: https://crrev.com/4f82b403f397fbad2e44fe287c05956fcb7cf282 Committed: https://crrev.com/d54345e651e054756b3c00fc80db05170f6cc129 Cr-Original-Commit-Position: refs/heads/master@{#406225} Cr-Commit-Position: refs/heads/master@{#406768}

Patch Set 1 #

Patch Set 2 #

Total comments: 11

Patch Set 3 #

Patch Set 4 #

Patch Set 5 : . #

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -572 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context.h View 1 2 1 chunk +6 lines, -5 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context.cc View 1 2 3 2 chunks +22 lines, -4 lines 0 comments Download
M chrome/browser/notifications/notification_permission_context_unittest.cc View 1 2 3 5 chunks +70 lines, -9 lines 0 comments Download
M chrome/browser/permissions/permission_manager.cc View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/permissions/permission_request_impl.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 2 3 4 6 chunks +3 lines, -26 lines 0 comments Download
D chrome/browser/push_messaging/push_messaging_permission_context.h View 1 2 1 chunk +0 lines, -62 lines 0 comments Download
D chrome/browser/push_messaging/push_messaging_permission_context.cc View 1 2 3 4 5 1 chunk +0 lines, -139 lines 0 comments Download
D chrome/browser/push_messaging/push_messaging_permission_context_unittest.cc View 1 2 1 chunk +0 lines, -314 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 39 (21 generated)
raymes
Hey Peter, Let me know if this approach seems reasonable to you. If it looks ...
4 years, 5 months ago (2016-07-14 01:47:57 UTC) #3
Peter Beverloo
lgtm, thank you! +miguelg in case he wants to have a look https://codereview.chromium.org/2149883002/diff/20001/chrome/browser/notifications/notification_permission_context.cc File chrome/browser/notifications/notification_permission_context.cc ...
4 years, 5 months ago (2016-07-14 17:15:19 UTC) #6
johnme
FWIW this changes the API semantics slightly: previously PushManager.permissionState would only resolve to "granted" if ...
4 years, 5 months ago (2016-07-14 17:26:35 UTC) #7
Miguel Garcia
lgtm https://codereview.chromium.org/2149883002/diff/20001/chrome/browser/notifications/notification_permission_context.cc File chrome/browser/notifications/notification_permission_context.cc (right): https://codereview.chromium.org/2149883002/diff/20001/chrome/browser/notifications/notification_permission_context.cc#newcode178 chrome/browser/notifications/notification_permission_context.cc:178: if (permission_type() == content::PermissionType::PUSH_MESSAGING && perhaps it's worth ...
4 years, 5 months ago (2016-07-14 18:02:04 UTC) #8
raymes
Thanks all! https://codereview.chromium.org/2149883002/diff/20001/chrome/browser/notifications/notification_permission_context.cc File chrome/browser/notifications/notification_permission_context.cc (right): https://codereview.chromium.org/2149883002/diff/20001/chrome/browser/notifications/notification_permission_context.cc#newcode178 chrome/browser/notifications/notification_permission_context.cc:178: if (permission_type() == content::PermissionType::PUSH_MESSAGING && On 2016/07/14 ...
4 years, 5 months ago (2016-07-18 07:04:51 UTC) #9
raymes
On 2016/07/14 17:26:35, johnme wrote: > FWIW this changes the API semantics slightly: previously > ...
4 years, 5 months ago (2016-07-18 07:05:31 UTC) #10
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/2149883002/30001
4 years, 5 months ago (2016-07-18 07:05:49 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/246364)
4 years, 5 months ago (2016-07-18 07:34:46 UTC) #15
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/2149883002/50001
4 years, 5 months ago (2016-07-19 01:10:08 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/194996)
4 years, 5 months ago (2016-07-19 01:55:59 UTC) #20
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/2149883002/70001
4 years, 5 months ago (2016-07-19 05:18:22 UTC) #23
commit-bot: I haz the power
Committed patchset #5 (id:70001)
4 years, 5 months ago (2016-07-19 07:04:52 UTC) #25
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/4f82b403f397fbad2e44fe287c05956fcb7cf282 Cr-Commit-Position: refs/heads/master@{#406225}
4 years, 5 months ago (2016-07-19 07:06:01 UTC) #27
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/2149883002/90001
4 years, 5 months ago (2016-07-21 01:18:26 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/196453)
4 years, 5 months ago (2016-07-21 02:47:26 UTC) #33
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/2149883002/90001
4 years, 5 months ago (2016-07-21 04:16:38 UTC) #35
commit-bot: I haz the power
Committed patchset #6 (id:90001)
4 years, 5 months ago (2016-07-21 04:58:29 UTC) #37
commit-bot: I haz the power
4 years, 5 months ago (2016-07-21 05:00:45 UTC) #39
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/d54345e651e054756b3c00fc80db05170f6cc129
Cr-Commit-Position: refs/heads/master@{#406768}

Powered by Google App Engine
This is Rietveld 408576698