OLD | NEW |
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 bool NotificationDelegate::HasClickedListener() { return false; } | 11 bool NotificationDelegate::HasClickedListener() { return false; } |
12 | 12 |
13 void NotificationDelegate::ButtonClick(int button_index) {} | 13 void NotificationDelegate::ButtonClick(int button_index) {} |
14 | 14 |
15 // HandleNotificationClickedDelegate: | 15 // HandleNotificationClickedDelegate: |
16 | 16 |
17 HandleNotificationClickedDelegate::HandleNotificationClickedDelegate( | 17 HandleNotificationClickedDelegate::HandleNotificationClickedDelegate( |
18 const base::Closure& closure) | 18 const base::Closure& closure) |
19 : closure_(closure) { | 19 : closure_(closure) { |
20 } | 20 } |
21 | 21 |
22 HandleNotificationClickedDelegate::~HandleNotificationClickedDelegate() { | 22 HandleNotificationClickedDelegate::~HandleNotificationClickedDelegate() { |
23 } | 23 } |
24 | 24 |
25 void HandleNotificationClickedDelegate::Display() { | 25 void HandleNotificationClickedDelegate::Display() { |
26 } | 26 } |
27 | 27 |
28 void HandleNotificationClickedDelegate::Error() { | |
29 } | |
30 | |
31 void HandleNotificationClickedDelegate::Close(bool by_user) { | 28 void HandleNotificationClickedDelegate::Close(bool by_user) { |
32 } | 29 } |
33 | 30 |
34 bool HandleNotificationClickedDelegate::HasClickedListener() { | 31 bool HandleNotificationClickedDelegate::HasClickedListener() { |
35 return !closure_.is_null(); | 32 return !closure_.is_null(); |
36 } | 33 } |
37 | 34 |
38 void HandleNotificationClickedDelegate::Click() { | 35 void HandleNotificationClickedDelegate::Click() { |
39 if (!closure_.is_null()) | 36 if (!closure_.is_null()) |
40 closure_.Run(); | 37 closure_.Run(); |
41 } | 38 } |
42 | 39 |
43 void HandleNotificationClickedDelegate::ButtonClick(int button_index) { | 40 void HandleNotificationClickedDelegate::ButtonClick(int button_index) { |
44 } | 41 } |
45 | 42 |
46 // HandleNotificationButtonClickDelegate: | 43 // HandleNotificationButtonClickDelegate: |
47 | 44 |
48 HandleNotificationButtonClickDelegate::HandleNotificationButtonClickDelegate( | 45 HandleNotificationButtonClickDelegate::HandleNotificationButtonClickDelegate( |
49 const ButtonClickCallback& button_callback) | 46 const ButtonClickCallback& button_callback) |
50 : button_callback_(button_callback) { | 47 : button_callback_(button_callback) { |
51 } | 48 } |
52 | 49 |
53 HandleNotificationButtonClickDelegate:: | 50 HandleNotificationButtonClickDelegate:: |
54 ~HandleNotificationButtonClickDelegate() { | 51 ~HandleNotificationButtonClickDelegate() { |
55 } | 52 } |
56 | 53 |
57 void HandleNotificationButtonClickDelegate::Display() { | 54 void HandleNotificationButtonClickDelegate::Display() { |
58 } | 55 } |
59 | 56 |
60 void HandleNotificationButtonClickDelegate::Error() { | |
61 } | |
62 | |
63 void HandleNotificationButtonClickDelegate::Close(bool by_user) { | 57 void HandleNotificationButtonClickDelegate::Close(bool by_user) { |
64 } | 58 } |
65 | 59 |
66 void HandleNotificationButtonClickDelegate::Click() { | 60 void HandleNotificationButtonClickDelegate::Click() { |
67 } | 61 } |
68 | 62 |
69 void HandleNotificationButtonClickDelegate::ButtonClick(int button_index) { | 63 void HandleNotificationButtonClickDelegate::ButtonClick(int button_index) { |
70 if (!button_callback_.is_null()) | 64 if (!button_callback_.is_null()) |
71 button_callback_.Run(button_index); | 65 button_callback_.Run(button_index); |
72 } | 66 } |
73 | 67 |
74 } // namespace message_center | 68 } // namespace message_center |
OLD | NEW |