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

Side by Side Diff: chrome/browser/notifications/notification.h

Issue 2151993002: [WebAPKs] Plumb service worker scope to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into notification_scope Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 Notification(const std::string& id, const Notification& notification); 37 Notification(const std::string& id, const Notification& notification);
38 38
39 Notification(const Notification& notification); 39 Notification(const Notification& notification);
40 ~Notification() override; 40 ~Notification() override;
41 Notification& operator=(const Notification& notification); 41 Notification& operator=(const Notification& notification);
42 42
43 // A unique identifier used to update (replace) or remove a notification. 43 // A unique identifier used to update (replace) or remove a notification.
44 const std::string& tag() const { return tag_; } 44 const std::string& tag() const { return tag_; }
45 45
46 const GURL& scope_url() const { return scope_url_; }
47 void set_scope_url(const GURL& scope_url) { scope_url_ = scope_url; }
48
46 // Id of the delegate embedded inside this instance. 49 // Id of the delegate embedded inside this instance.
47 std::string delegate_id() const { return delegate()->id(); } 50 std::string delegate_id() const { return delegate()->id(); }
48 51
49 NotificationDelegate* delegate() const { return delegate_.get(); } 52 NotificationDelegate* delegate() const { return delegate_.get(); }
50 53
51 private: 54 private:
52 // The user-supplied tag for the notification. 55 // The user-supplied tag for the notification.
53 std::string tag_; 56 std::string tag_;
54 57
58 // The service worker scope if the notification was displayed by a service
59 // worker.
60 GURL scope_url_;
61
55 // A proxy object that allows access back to the JavaScript object that 62 // A proxy object that allows access back to the JavaScript object that
56 // represents the notification, for firing events. 63 // represents the notification, for firing events.
57 scoped_refptr<NotificationDelegate> delegate_; 64 scoped_refptr<NotificationDelegate> delegate_;
58 }; 65 };
59 66
60 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ 67 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698