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

Unified Diff: chrome/browser/notifications/persistent_notification_delegate.cc

Issue 2300093002: Make //content responsible for generating notification Ids (Closed)
Patch Set: Make //content responsible for generating notification Ids Created 4 years, 3 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/persistent_notification_delegate.cc
diff --git a/chrome/browser/notifications/persistent_notification_delegate.cc b/chrome/browser/notifications/persistent_notification_delegate.cc
index 70f3aeae3dab8f77e9c9b45e4c98a892d88619fb..bf1516d6734008eb53b6891b1a24997854185e84 100644
--- a/chrome/browser/notifications/persistent_notification_delegate.cc
+++ b/chrome/browser/notifications/persistent_notification_delegate.cc
@@ -4,21 +4,16 @@
#include "chrome/browser/notifications/persistent_notification_delegate.h"
-#include "base/bind.h"
-#include "base/guid.h"
-#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
-#include "content/public/common/persistent_notification_status.h"
PersistentNotificationDelegate::PersistentNotificationDelegate(
content::BrowserContext* browser_context,
- int64_t persistent_notification_id,
+ const std::string& notification_id,
const GURL& origin,
int notification_settings_index)
: browser_context_(browser_context),
- persistent_notification_id_(persistent_notification_id),
+ notification_id_(notification_id),
origin_(origin),
- id_(base::GenerateGUID()),
notification_settings_index_(notification_settings_index) {}
PersistentNotificationDelegate::~PersistentNotificationDelegate() {}
@@ -27,18 +22,12 @@ void PersistentNotificationDelegate::Display() {}
void PersistentNotificationDelegate::Close(bool by_user) {
PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose(
- browser_context_,
- persistent_notification_id_,
- origin_,
- by_user);
+ browser_context_, notification_id_, origin_, by_user);
}
void PersistentNotificationDelegate::Click() {
PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
- browser_context_,
- persistent_notification_id_,
- origin_,
- -1 /* action_index */);
+ browser_context_, notification_id_, origin_, -1 /* action_index */);
}
void PersistentNotificationDelegate::ButtonClick(int button_index) {
@@ -49,15 +38,11 @@ void PersistentNotificationDelegate::ButtonClick(int button_index) {
}
PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
- browser_context_,
- persistent_notification_id_,
- origin_,
- button_index);
+ browser_context_, notification_id_, origin_, button_index);
}
void PersistentNotificationDelegate::SettingsClick() {
NotificationCommon::OpenNotificationSettings(browser_context_);
- return;
}
bool PersistentNotificationDelegate::ShouldDisplaySettingsButton() {
@@ -65,5 +50,5 @@ bool PersistentNotificationDelegate::ShouldDisplaySettingsButton() {
}
std::string PersistentNotificationDelegate::id() const {
- return id_;
+ return notification_id_;
}

Powered by Google App Engine
This is Rietveld 408576698