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

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

Issue 385058: When extensions use notifications, display the name of the extension in UI ra... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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.h
===================================================================
--- chrome/browser/notifications/notification.h (revision 31723)
+++ chrome/browser/notifications/notification.h (working copy)
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
+#include <string>
+
#include "base/basictypes.h"
#include "chrome/browser/notifications/notification_object_proxy.h"
#include "googleurl/src/gurl.h"
@@ -15,15 +17,18 @@
class Notification {
public:
Notification(const GURL& origin_url, const GURL& content_url,
+ const std::wstring& display_source,
NotificationObjectProxy* proxy)
: origin_url_(origin_url),
content_url_(content_url),
+ display_source_(display_source),
proxy_(proxy) {
}
Notification(const Notification& notification)
: origin_url_(notification.origin_url()),
content_url_(notification.content_url()),
+ display_source_(notification.display_source()),
proxy_(notification.proxy()) {
}
@@ -33,6 +38,9 @@
// The origin URL of the script which requested the notification.
const GURL& origin_url() const { return origin_url_; }
+ // A display string for the source of the notification.
+ const std::wstring& display_source() const { return display_source_; }
+
void Display() const { proxy()->Display(); }
void Error() const { proxy()->Error(); }
void Close(bool by_user) const { proxy()->Close(by_user); }
@@ -51,6 +59,10 @@
// string-based notifications).
GURL content_url_;
+ // The display string for the source of the notification. Could be
+ // the same as origin_url_, or the name of an extension.
+ std::wstring display_source_;
+
// A proxy object that allows access back to the JavaScript object that
// represents the notification, for firing events.
scoped_refptr<NotificationObjectProxy> proxy_;
« no previous file with comments | « chrome/browser/notifications/desktop_notifications_unittest.cc ('k') | chrome/browser/views/notifications/balloon_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698