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

Unified Diff: chrome/browser/notifications/web_notification_delegate.h

Issue 2906883003: Deprecate per notification type delegates. (Closed)
Patch Set: review Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/web_notification_delegate.h
diff --git a/chrome/browser/notifications/web_notification_delegate.h b/chrome/browser/notifications/web_notification_delegate.h
index d4629fc6f4b68891d4de58e8047cc71e9cc5bf87..592ef7934d20e30ebcd3957440b2b866432feaaa 100644
--- a/chrome/browser/notifications/web_notification_delegate.h
+++ b/chrome/browser/notifications/web_notification_delegate.h
@@ -9,12 +9,11 @@
#include "base/feature_list.h"
#include "base/macros.h"
+#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/notification_delegate.h"
#include "url/gurl.h"
-namespace content {
-class BrowserContext;
-}
+class Profile;
namespace features {
@@ -22,31 +21,33 @@ extern const base::Feature kAllowFullscreenWebNotificationsFeature;
} // namespace features
-// Base class for the PersistentNotificationDelegate and the
-// NotificationObjectProxy. All common functionality for displaying web
-// notifications is found here.
-// TODO(peter, crbug.com/596161): Migrate this functionality offered by the
-// delegate to the NotificationDisplayService.
+// Delegate class for Web Notifications.
class WebNotificationDelegate : public NotificationDelegate {
public:
+ WebNotificationDelegate(NotificationCommon::Type notification_type,
+ Profile* profile,
+ const std::string& notification_id,
+ const GURL& origin);
+
// NotificationDelegate implementation.
std::string id() const override;
bool SettingsClick() override;
bool ShouldDisplaySettingsButton() override;
bool ShouldDisplayOverFullscreen() const override;
+ void Display() override;
+ void Close(bool by_user) override;
+ void Click() override;
+ void ButtonClick(int button_index) override;
+ void ButtonClickWithReply(int button_index,
+ const base::string16& reply) override;
protected:
- WebNotificationDelegate(content::BrowserContext* browser_context,
- const std::string& notification_id,
- const GURL& origin);
-
~WebNotificationDelegate() override;
-
- content::BrowserContext* browser_context() { return browser_context_; }
const GURL& origin() { return origin_; }
private:
- content::BrowserContext* browser_context_;
+ NotificationCommon::Type notification_type_;
+ Profile* profile_;
std::string notification_id_;
GURL origin_;

Powered by Google App Engine
This is Rietveld 408576698