 Chromium Code Reviews
 Chromium Code Reviews Issue 2888303004:
  Minimize the delegate dependencies for non persistent notifications.  (Closed)
    
  
    Issue 2888303004:
  Minimize the delegate dependencies for non persistent notifications.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_EVENT_DISPATCHER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_EVENT_DISPATCHER_H_ | 
| 6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_EVENT_DISPATCHER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_EVENT_DISPATCHER_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 // |dispatch_complete_callback| will be invoked when it's known whether the | 49 // |dispatch_complete_callback| will be invoked when it's known whether the | 
| 50 // event successfully executed. | 50 // event successfully executed. | 
| 51 virtual void DispatchNotificationCloseEvent( | 51 virtual void DispatchNotificationCloseEvent( | 
| 52 BrowserContext* browser_context, | 52 BrowserContext* browser_context, | 
| 53 const std::string& notification_id, | 53 const std::string& notification_id, | 
| 54 const GURL& origin, | 54 const GURL& origin, | 
| 55 bool by_user, | 55 bool by_user, | 
| 56 const NotificationDispatchCompleteCallback& | 56 const NotificationDispatchCompleteCallback& | 
| 57 dispatch_complete_callback) = 0; | 57 dispatch_complete_callback) = 0; | 
| 58 | 58 | 
| 59 // Register the renderer process that requested a notification with | |
| 60 // |notification_id| to be displayed. | |
| 61 virtual void RegisterNonPersistentNotification( | |
| 62 const std::string& notification_id, | |
| 63 int renderer_id, | |
| 64 int non_persistent_id) = 0; | |
| 
Peter Beverloo
2017/05/31 17:52:43
We should only define methods in the //content/pub
 
Miguel Garcia
2017/06/01 17:00:54
Done.
 | |
| 65 | |
| 66 // Dispatch methods for the different notification events. | |
| 
Peter Beverloo
2017/05/31 17:52:43
Please explain why these are different from the on
 
Miguel Garcia
2017/06/01 17:00:54
Done.
 | |
| 67 virtual void DispatchNonPersistentShowEvent( | |
| 68 const std::string& notification_id) = 0; | |
| 69 virtual void DispatchNonPersistentClickEvent( | |
| 70 const std::string& notification_id) = 0; | |
| 71 virtual void DispatchNonPersistentCloseEvent( | |
| 72 const std::string& notification_id) = 0; | |
| 73 | |
| 74 // Called when a renderer previously used to display notifications | |
| 75 // terminates. | |
| 76 virtual void RendererGone(int renderer_id) = 0; | |
| 
Peter Beverloo
2017/05/31 17:52:43
nit: DidShutdownRenderer()
We're already super la
 
Miguel Garcia
2017/06/01 17:00:54
Sure, it cleans up state on the browser when the r
 | |
| 77 | |
| 59 protected: | 78 protected: | 
| 60 virtual ~NotificationEventDispatcher() {} | 79 virtual ~NotificationEventDispatcher() {} | 
| 61 }; | 80 }; | 
| 62 | 81 | 
| 63 } // namespace content | 82 } // namespace content | 
| 64 | 83 | 
| 65 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_EVENT_DISPATCHER_H_ | 84 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_EVENT_DISPATCHER_H_ | 
| OLD | NEW |