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

Issue 2703213004: Migrate extension notifications to the new NotificationDisplayService (Closed)

Created:
3 years, 10 months ago by Peter Beverloo
Modified:
3 years, 8 months ago
CC:
chromium-reviews, Peter Beverloo, chromium-apps-reviews_chromium.org, mlamouri+watch-notifications_chromium.org, awdf+watch_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Migrate extension notifications to the new NotificationDisplayService Today, the implementation of the Notifications Extension API directly communicates with the NotificationUIManager. In doing so, it makes the assumption that displayed notifications can be retrieved in whole. However, since we're moving to native notification centers, which are powered by the NotificationDisplayService as opposed to the NotificationUIManager, we need to drop this assumption without breaking the extension API. This CL migrates the extension API to use the NDS while maintaining all existing functionality. (Assuming the Message Center is used to implement the NDS, moving away from which is a separate discussion in which extension compatibility concerns are being discussed.) BUG=596161 Review-Url: https://codereview.chromium.org/2703213004 Cr-Commit-Position: refs/heads/master@{#463671} Committed: https://chromium.googlesource.com/chromium/src/+/28d8b7398617c37736dd2e04afd656795e6cac28

Patch Set 1 #

Patch Set 2 : Checkpoint: Extensions code updated #

Patch Set 3 : Finish functionality #

Total comments: 22

Patch Set 4 : Miguel's comments #

Total comments: 7

Patch Set 5 : incognito + rebase #

Total comments: 4

Patch Set 6 : full rebase #

Patch Set 7 : another rebase #

Total comments: 22

Patch Set 8 : Migrate extension notifications to the new NotificationDisplayService #

Total comments: 2

Patch Set 9 : Migrate extension notifications to the new NotificationDisplayService #

Unified diffs Side-by-side diffs Delta from patch set Stats (+593 lines, -84 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/notifications/extension_notification_display_helper.h View 1 2 3 4 5 6 7 8 1 chunk +72 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc View 1 2 3 4 5 6 7 1 chunk +95 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h View 1 2 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.cc View 1 2 3 4 5 6 7 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/notifications/extension_notification_handler.h View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/notifications/extension_notification_handler.cc View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/notifications/notifications_api.h View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/notifications/notifications_api.cc View 1 2 3 4 5 6 7 11 chunks +28 lines, -16 lines 0 comments Download
M chrome/browser/extensions/api/notifications/notifications_apitest.cc View 1 2 3 4 18 chunks +87 lines, -64 lines 0 comments Download
M chrome/browser/notifications/native_notification_display_service.cc View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/notifications/non_persistent_notification_handler.cc View 1 2 3 4 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/notifications/notification_common.h View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/notifications/platform_notification_service_unittest.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/browser/notifications/stub_notification_display_service.h View 1 2 3 4 5 1 chunk +57 lines, -0 lines 0 comments Download
A chrome/browser/notifications/stub_notification_display_service.cc View 1 2 3 4 5 1 chunk +89 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (35 generated)
Miguel Garcia
Thanks for starting on this! I have mostly questions more than comments at this stage ...
3 years, 10 months ago (2017-02-21 10:56:44 UTC) #10
Peter Beverloo
PTAL https://codereview.chromium.org/2703213004/diff/40001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc File chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc (right): https://codereview.chromium.org/2703213004/diff/40001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc#newcode22 chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc:22: ExtensionNotificationDisplayHelper::~ExtensionNotificationDisplayHelper() {} On 2017/02/21 10:56:43, Miguel Garcia wrote: ...
3 years, 10 months ago (2017-02-21 17:23:51 UTC) #11
Miguel Garcia
lgtm I have one pending question there but if you are sure this is ok, ...
3 years, 10 months ago (2017-02-22 14:46:18 UTC) #16
Peter Beverloo
+dewittj, may I ask you to take a look? https://codereview.chromium.org/2703213004/diff/40001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc File chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc (right): https://codereview.chromium.org/2703213004/diff/40001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc#newcode53 chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc:53: ...
3 years, 9 months ago (2017-02-28 01:08:59 UTC) #18
swade0826
On 2017/02/28 01:08:59, Peter Beverloo (OOO - Mar 6th) wrote: > +dewittj, may I ask ...
3 years, 9 months ago (2017-03-01 10:34:30 UTC) #19
swade0826
On 2017/03/01 10:34:30, swade0826 wrote: > On 2017/02/28 01:08:59, Peter Beverloo (OOO - Mar 6th) ...
3 years, 9 months ago (2017-03-01 10:35:37 UTC) #20
swade0826
On 2017/03/01 10:35:37, swade0826 wrote: > On 2017/03/01 10:34:30, swade0826 wrote: > > On 2017/02/28 ...
3 years, 9 months ago (2017-03-01 10:44:34 UTC) #21
swade0826
On 2017/03/01 10:35:37, swade0826 wrote: > On 2017/03/01 10:34:30, swade0826 wrote: > > On 2017/02/28 ...
3 years, 9 months ago (2017-03-01 10:44:35 UTC) #22
Miguel Garcia
> Ah, different form of notification sync. > > Yeah, this is something we should ...
3 years, 9 months ago (2017-03-01 10:51:35 UTC) #23
dewittj
Any chance you have a doc for the proposed changes? Mostly looks fine barring a ...
3 years, 9 months ago (2017-03-01 17:59:09 UTC) #24
Peter Beverloo
Thanks Justin! I missed your reply. The design document lives here (private): https://docs.google.com/document/d/1u5Uqz240WcMTB__D_tMEFsqMaLg2eaQmj_rNFKCsmN8/edit, which, admittedly, ...
3 years, 8 months ago (2017-04-05 23:22:12 UTC) #25
Peter Beverloo
This should now be ready, PTAL Justin https://codereview.chromium.org/2703213004/diff/60001/chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.cc File chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.cc (right): https://codereview.chromium.org/2703213004/diff/60001/chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.cc#newcode23 chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.cc:23: GetInstance()->GetServiceForBrowserContext(profile, true ...
3 years, 8 months ago (2017-04-07 17:33:29 UTC) #32
Peter Beverloo
+devlin, PTAL
3 years, 8 months ago (2017-04-10 17:48:19 UTC) #36
dewittj
lgtm https://codereview.chromium.org/2703213004/diff/80001/chrome/browser/extensions/api/notifications/notifications_apitest.cc File chrome/browser/extensions/api/notifications/notifications_apitest.cc (right): https://codereview.chromium.org/2703213004/diff/80001/chrome/browser/extensions/api/notifications/notifications_apitest.cc#newcode230 chrome/browser/extensions/api/notifications/notifications_apitest.cc:230: #if (defined(OS_LINUX) || defined(OS_WIN)) && !defined(NDEBUG) :( https://codereview.chromium.org/2703213004/diff/80001/chrome/browser/notifications/platform_notification_service_unittest.cc ...
3 years, 8 months ago (2017-04-10 17:51:23 UTC) #37
Devlin
https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc File chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc (right): https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc#newcode38 chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc:38: for (const std::unique_ptr<Notification>& notification : notifications_) { optional: const ...
3 years, 8 months ago (2017-04-10 21:23:55 UTC) #42
Peter Beverloo
Thanks! I'll apply all changes in the morning - mind if I submit after I ...
3 years, 8 months ago (2017-04-10 23:30:06 UTC) #43
Peter Beverloo
https://codereview.chromium.org/2703213004/diff/80001/chrome/browser/extensions/api/notifications/notifications_apitest.cc File chrome/browser/extensions/api/notifications/notifications_apitest.cc (right): https://codereview.chromium.org/2703213004/diff/80001/chrome/browser/extensions/api/notifications/notifications_apitest.cc#newcode230 chrome/browser/extensions/api/notifications/notifications_apitest.cc:230: #if (defined(OS_LINUX) || defined(OS_WIN)) && !defined(NDEBUG) On 2017/04/10 17:51:23, ...
3 years, 8 months ago (2017-04-11 00:39:21 UTC) #44
Devlin
On 2017/04/10 23:30:06, Peter Beverloo wrote: > Thanks! I'll apply all changes in the morning ...
3 years, 8 months ago (2017-04-11 01:48:02 UTC) #45
Devlin
https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h File chrome/browser/extensions/api/notifications/extension_notification_display_helper.h (right): https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h#newcode29 chrome/browser/extensions/api/notifications/extension_notification_display_helper.h:29: class ExtensionNotificationDisplayHelper : public KeyedService { Forgot one comment ...
3 years, 8 months ago (2017-04-11 01:51:56 UTC) #46
Peter Beverloo
Thanks! This CL makes possible as opposed to enables, so can land while we continue ...
3 years, 8 months ago (2017-04-11 14:19:25 UTC) #51
Devlin
https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h File chrome/browser/extensions/api/notifications/extension_notification_display_helper.h (right): https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h#newcode29 chrome/browser/extensions/api/notifications/extension_notification_display_helper.h:29: class ExtensionNotificationDisplayHelper : public KeyedService { On 2017/04/11 14:19:25, ...
3 years, 8 months ago (2017-04-11 14:55:23 UTC) #52
Devlin
On 2017/04/11 14:55:23, Devlin wrote: > https://codereview.chromium.org/2703213004/diff/120001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h > File > chrome/browser/extensions/api/notifications/extension_notification_display_helper.h > (right): > > ...
3 years, 8 months ago (2017-04-11 14:56:27 UTC) #53
Peter Beverloo
Thank you! https://codereview.chromium.org/2703213004/diff/140001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h File chrome/browser/extensions/api/notifications/extension_notification_display_helper.h (right): https://codereview.chromium.org/2703213004/diff/140001/chrome/browser/extensions/api/notifications/extension_notification_display_helper.h#newcode29 chrome/browser/extensions/api/notifications/extension_notification_display_helper.h:29: using NotificationVector = std::vector<std::unique_ptr<Notification>>; On 2017/04/11 14:55:23, ...
3 years, 8 months ago (2017-04-11 15:03:36 UTC) #54
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/2703213004/160001
3 years, 8 months ago (2017-04-11 15:04:05 UTC) #57
commit-bot: I haz the power
3 years, 8 months ago (2017-04-11 17:37:21 UTC) #60
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/28d8b7398617c37736dd2e04afd6...

Powered by Google App Engine
This is Rietveld 408576698