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

Issue 2916383004: Revert of Minimize the delegate dependencies for non persistent notifications. (Closed)

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

Description

Revert of Minimize the delegate dependencies for non persistent notifications. (patchset #5 id:80001 of https://codereview.chromium.org/2888303004/ ) Reason for revert: This broke the unit test PlatformNotificationServiceTest.DisplayPageDisplayedEvent see https://uberchromegw.corp.google.com/i/chromium.android/builders/Android%20N5X%20Swarm%20Builder/builds/12814 Original issue's description: > Minimize the delegate dependencies for non persistent notifications. > > Upgrade NotificationEventDispatcher to support IPCs for non persistent notifications > as well as persistent ones. > > Use the dispatcher directly from the handler. > > After this patch land we will be able to use the same path for non native notifications and > get rid of the delegate #ifdefs > > This work is happening in > https://codereview.chromium.org/2906913002#ps1 > and > https://codereview.chromium.org/2906883003#ps1 > > > BUG=720345 > > Review-Url: https://codereview.chromium.org/2888303004 > Cr-Commit-Position: refs/heads/master@{#476646} > Committed: https://chromium.googlesource.com/chromium/src/+/26f0196082493c3d5109f196828a8c5baf16005a TBR=peter@chromium.org,dewittj@chromium.org,avi@chromium.org,miguelg@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=720345

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -264 lines) Patch
M chrome/browser/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/notifications/extension_notification_handler.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/notifications/extension_notification_handler.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/notifications/notifications_api.cc View 3 chunks +27 lines, -8 lines 0 comments Download
D chrome/browser/notifications/native_notification_delegate.h View 1 chunk +0 lines, -30 lines 0 comments Download
D chrome/browser/notifications/native_notification_delegate.cc View 1 chunk +0 lines, -9 lines 0 comments Download
M chrome/browser/notifications/native_notification_display_service.cc View 2 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/notifications/non_persistent_notification_handler.h View 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/notifications/non_persistent_notification_handler.cc View 3 chunks +18 lines, -9 lines 0 comments Download
M chrome/browser/notifications/notification_handler.h View 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/notifications/notification_interactive_uitest_support.cc View 2 chunks +2 lines, -16 lines 0 comments Download
M chrome/browser/notifications/persistent_notification_handler.h View 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/notifications/persistent_notification_handler.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/notifications/platform_notification_service_impl.cc View 7 chunks +7 lines, -25 lines 0 comments Download
M chrome/browser/notifications/platform_notification_service_interactive_uitest.cc View 3 chunks +5 lines, -20 lines 0 comments Download
M chrome/browser/notifications/platform_notification_service_unittest.cc View 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/notifications/notification_event_dispatcher_impl.h View 2 chunks +0 lines, -24 lines 0 comments Download
M content/browser/notifications/notification_event_dispatcher_impl.cc View 3 chunks +3 lines, -80 lines 0 comments Download
M content/browser/notifications/notification_message_filter.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/notifications/notification_message_filter.cc View 4 chunks +1 line, -15 lines 0 comments Download
M content/public/browser/notification_event_dispatcher.h View 2 chunks +0 lines, -12 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
michaelbai
Created Revert of Minimize the delegate dependencies for non persistent notifications.
3 years, 6 months ago (2017-06-02 23:26:00 UTC) #2
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/2916383004/1
3 years, 6 months ago (2017-06-02 23:26:42 UTC) #3
commit-bot: I haz the power
3 years, 6 months ago (2017-06-02 23:27:12 UTC) #5
Failed to apply patch for
chrome/browser/notifications/native_notification_display_service.cc:
While running git apply --index -3 -p1;
  error: patch failed:
chrome/browser/notifications/native_notification_display_service.cc:21
  error: repository lacks the necessary blob to fall back on 3-way merge.
  error: chrome/browser/notifications/native_notification_display_service.cc:
patch does not apply

Patch:       chrome/browser/notifications/native_notification_display_service.cc
Index: chrome/browser/notifications/native_notification_display_service.cc
diff --git a/chrome/browser/notifications/native_notification_display_service.cc
b/chrome/browser/notifications/native_notification_display_service.cc
index
2781af6c926d89d4c9998f73e3801164025585fb..2ffcd75fd3929c32998c54c28a73145fdbef9796
100644
--- a/chrome/browser/notifications/native_notification_display_service.cc
+++ b/chrome/browser/notifications/native_notification_display_service.cc
@@ -21,7 +21,6 @@
 #include "chrome/browser/notifications/persistent_notification_handler.h"
 #include "chrome/browser/profiles/profile.h"
 #include "content/public/browser/browser_thread.h"
-#include "content/public/browser/notification_event_dispatcher.h"
 #include "extensions/features/features.h"
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -94,13 +93,9 @@
     notification_bridge_->Display(notification_type, notification_id,
                                   GetProfileId(profile_),
                                   profile_->IsOffTheRecord(), notification);
-    // Unlike all other notifications non persistent notifications require
-    // an event after the notification has been displayed.
-    // TODO(miguelg) create an OnShow notification handler instead.
-    if (notification_type == NotificationCommon::NON_PERSISTENT) {
-      content::NotificationEventDispatcher::GetInstance()
-          ->DispatchNonPersistentShowEvent(notification_id);
-    }
+    notification.delegate()->Display();
+    NotificationHandler* handler = GetNotificationHandler(notification_type);
+    handler->RegisterNotification(notification_id, notification.delegate());
   } else if (message_center_display_service_) {
     message_center_display_service_->Display(notification_type,
notification_id,
                                              notification);

Powered by Google App Engine
This is Rietveld 408576698