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

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

Issue 2300093002: Make //content responsible for generating notification Ids (Closed)
Patch Set: comments 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/notification_object_proxy.cc
diff --git a/chrome/browser/notifications/notification_object_proxy.cc b/chrome/browser/notifications/notification_object_proxy.cc
index 07fe0e546b5b3d3dd46917e9e9c321682ab345f7..f07a308104e0859c49d04127ffc5e795de0529d1 100644
--- a/chrome/browser/notifications/notification_object_proxy.cc
+++ b/chrome/browser/notifications/notification_object_proxy.cc
@@ -6,19 +6,18 @@
#include <utility>
-#include "base/guid.h"
#include "base/logging.h"
-#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "content/public/browser/desktop_notification_delegate.h"
NotificationObjectProxy::NotificationObjectProxy(
content::BrowserContext* browser_context,
+ const std::string& notification_id,
std::unique_ptr<content::DesktopNotificationDelegate> delegate)
: browser_context_(browser_context),
delegate_(std::move(delegate)),
displayed_(false),
- id_(base::GenerateGUID()) {}
+ notification_id_(notification_id) {}
NotificationObjectProxy::~NotificationObjectProxy() {}
@@ -27,6 +26,7 @@ void NotificationObjectProxy::Display() {
// but we only want to fire the event the first time.
if (displayed_)
return;
+
displayed_ = true;
delegate_->NotificationDisplayed();
@@ -43,12 +43,12 @@ void NotificationObjectProxy::Click() {
void NotificationObjectProxy::ButtonClick(int button_index) {
// Notification buttons not are supported for non persistent notifications.
DCHECK_EQ(button_index, 0);
+
NotificationCommon::OpenNotificationSettings(browser_context_);
}
void NotificationObjectProxy::SettingsClick() {
NotificationCommon::OpenNotificationSettings(browser_context_);
- return;
}
bool NotificationObjectProxy::ShouldDisplaySettingsButton() {
@@ -56,5 +56,5 @@ bool NotificationObjectProxy::ShouldDisplaySettingsButton() {
}
std::string NotificationObjectProxy::id() const {
- return id_;
+ return notification_id_;
}
« no previous file with comments | « chrome/browser/notifications/notification_object_proxy.h ('k') | chrome/browser/notifications/notification_platform_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698