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

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

Issue 684253002: Provide default implementations for NotificationDelegate methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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_delegate.h ('k') | no next file » | 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 #include "ui/message_center/notification_delegate.h" 5 #include "ui/message_center/notification_delegate.h"
6 6
7 namespace message_center { 7 namespace message_center {
8 8
9 // NotificationDelegate: 9 // NotificationDelegate:
10 10
11 void NotificationDelegate::Display() {}
12
13 void NotificationDelegate::Error() {}
14
15 void NotificationDelegate::Close(bool by_user) {}
16
11 bool NotificationDelegate::HasClickedListener() { return false; } 17 bool NotificationDelegate::HasClickedListener() { return false; }
12 18
19 void NotificationDelegate::Click() {}
20
13 void NotificationDelegate::ButtonClick(int button_index) {} 21 void NotificationDelegate::ButtonClick(int button_index) {}
14 22
15 // HandleNotificationClickedDelegate: 23 // HandleNotificationClickedDelegate:
16 24
17 HandleNotificationClickedDelegate::HandleNotificationClickedDelegate( 25 HandleNotificationClickedDelegate::HandleNotificationClickedDelegate(
18 const base::Closure& closure) 26 const base::Closure& closure)
19 : closure_(closure) { 27 : closure_(closure) {
20 } 28 }
21 29
22 HandleNotificationClickedDelegate::~HandleNotificationClickedDelegate() { 30 HandleNotificationClickedDelegate::~HandleNotificationClickedDelegate() {}
23 }
24
25 void HandleNotificationClickedDelegate::Display() {
26 }
27
28 void HandleNotificationClickedDelegate::Error() {
29 }
30
31 void HandleNotificationClickedDelegate::Close(bool by_user) {
32 }
33 31
34 bool HandleNotificationClickedDelegate::HasClickedListener() { 32 bool HandleNotificationClickedDelegate::HasClickedListener() {
35 return !closure_.is_null(); 33 return !closure_.is_null();
36 } 34 }
37 35
38 void HandleNotificationClickedDelegate::Click() { 36 void HandleNotificationClickedDelegate::Click() {
39 if (!closure_.is_null()) 37 if (!closure_.is_null())
40 closure_.Run(); 38 closure_.Run();
41 } 39 }
42 40
43 void HandleNotificationClickedDelegate::ButtonClick(int button_index) {
44 }
45
46 // HandleNotificationButtonClickDelegate: 41 // HandleNotificationButtonClickDelegate:
47 42
48 HandleNotificationButtonClickDelegate::HandleNotificationButtonClickDelegate( 43 HandleNotificationButtonClickDelegate::HandleNotificationButtonClickDelegate(
49 const ButtonClickCallback& button_callback) 44 const ButtonClickCallback& button_callback)
50 : button_callback_(button_callback) { 45 : button_callback_(button_callback) {
51 } 46 }
52 47
53 HandleNotificationButtonClickDelegate:: 48 HandleNotificationButtonClickDelegate::
54 ~HandleNotificationButtonClickDelegate() { 49 ~HandleNotificationButtonClickDelegate() {}
55 }
56
57 void HandleNotificationButtonClickDelegate::Display() {
58 }
59
60 void HandleNotificationButtonClickDelegate::Error() {
61 }
62
63 void HandleNotificationButtonClickDelegate::Close(bool by_user) {
64 }
65
66 void HandleNotificationButtonClickDelegate::Click() {
67 }
68 50
69 void HandleNotificationButtonClickDelegate::ButtonClick(int button_index) { 51 void HandleNotificationButtonClickDelegate::ButtonClick(int button_index) {
70 if (!button_callback_.is_null()) 52 if (!button_callback_.is_null())
71 button_callback_.Run(button_index); 53 button_callback_.Run(button_index);
72 } 54 }
73 55
74 } // namespace message_center 56 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/notification_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698