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

Side by Side Diff: ui/message_center/notification_delegate.h

Issue 687183004: Remove the OnError method from notification delegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_
6 #define UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ 6 #define UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "ui/message_center/message_center_export.h" 12 #include "ui/message_center/message_center_export.h"
13 13
14 namespace content { 14 namespace content {
15 class RenderViewHost; 15 class RenderViewHost;
16 } 16 }
17 17
18 namespace message_center { 18 namespace message_center {
19 19
20 // Delegate for a notification. This class has two roles: to implement callback 20 // Delegate for a notification. This class has two roles: to implement callback
21 // methods for notification, and to provide an identity of the associated 21 // methods for notification, and to provide an identity of the associated
22 // notification. 22 // notification.
23 class MESSAGE_CENTER_EXPORT NotificationDelegate 23 class MESSAGE_CENTER_EXPORT NotificationDelegate
24 : public base::RefCountedThreadSafe<NotificationDelegate> { 24 : public base::RefCountedThreadSafe<NotificationDelegate> {
25 public: 25 public:
26 // To be called when the desktop notification is actually shown. 26 // To be called when the desktop notification is actually shown.
27 virtual void Display(); 27 virtual void Display();
28 28
29 // To be called when the desktop notification cannot be shown due to an
30 // error.
31 virtual void Error();
32
33 // To be called when the desktop notification is closed. If closed by a 29 // To be called when the desktop notification is closed. If closed by a
34 // user explicitly (as opposed to timeout/script), |by_user| should be true. 30 // user explicitly (as opposed to timeout/script), |by_user| should be true.
35 virtual void Close(bool by_user); 31 virtual void Close(bool by_user);
36 32
37 // Returns true if the delegate can handle click event. 33 // Returns true if the delegate can handle click event.
38 virtual bool HasClickedListener(); 34 virtual bool HasClickedListener();
39 35
40 // To be called when a desktop notification is clicked. 36 // To be called when a desktop notification is clicked.
41 virtual void Click(); 37 virtual void Click();
42 38
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 84
89 private: 85 private:
90 ButtonClickCallback button_callback_; 86 ButtonClickCallback button_callback_;
91 87
92 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); 88 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate);
93 }; 89 };
94 90
95 } // namespace message_center 91 } // namespace message_center
96 92
97 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ 93 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698