[email protected] | 7fde24af7 | 2013-05-28 17:19:03 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "ui/message_center/notification_delegate.h" | ||||
6 | |||||
awdf | f42998e | 2016-10-13 16:58:54 | [diff] [blame] | 7 | #include "base/logging.h" |
8 | |||||
[email protected] | 7fde24af7 | 2013-05-28 17:19:03 | [diff] [blame] | 9 | namespace message_center { |
10 | |||||
[email protected] | 657116e | 2014-04-09 14:10:16 | [diff] [blame] | 11 | // NotificationDelegate: |
12 | |||||
peter | cf29ede8 | 2014-10-30 23:19:19 | [diff] [blame] | 13 | void NotificationDelegate::Display() {} |
14 | |||||
peter | cf29ede8 | 2014-10-30 23:19:19 | [diff] [blame] | 15 | void NotificationDelegate::Close(bool by_user) {} |
16 | |||||
[email protected] | 7fde24af7 | 2013-05-28 17:19:03 | [diff] [blame] | 17 | bool NotificationDelegate::HasClickedListener() { return false; } |
18 | |||||
peter | cf29ede8 | 2014-10-30 23:19:19 | [diff] [blame] | 19 | void NotificationDelegate::Click() {} |
20 | |||||
[email protected] | 7fde24af7 | 2013-05-28 17:19:03 | [diff] [blame] | 21 | void NotificationDelegate::ButtonClick(int button_index) {} |
22 | |||||
awdf | f42998e | 2016-10-13 16:58:54 | [diff] [blame] | 23 | void NotificationDelegate::ButtonClickWithReply(int button_index, |
24 | const base::string16& reply) { | ||||
25 | NOTIMPLEMENTED(); | ||||
26 | } | ||||
27 | |||||
miguelg | b688a84 | 2015-10-21 13:19:21 | [diff] [blame] | 28 | void NotificationDelegate::SettingsClick() {} |
29 | |||||
30 | bool NotificationDelegate::ShouldDisplaySettingsButton() { | ||||
31 | return false; | ||||
32 | } | ||||
33 | |||||
[email protected] | 657116e | 2014-04-09 14:10:16 | [diff] [blame] | 34 | // HandleNotificationClickedDelegate: |
35 | |||||
[email protected] | 120a0dd | 2013-08-02 08:44:12 | [diff] [blame] | 36 | HandleNotificationClickedDelegate::HandleNotificationClickedDelegate( |
37 | const base::Closure& closure) | ||||
38 | : closure_(closure) { | ||||
39 | } | ||||
40 | |||||
peter | cf29ede8 | 2014-10-30 23:19:19 | [diff] [blame] | 41 | HandleNotificationClickedDelegate::~HandleNotificationClickedDelegate() {} |
[email protected] | 120a0dd | 2013-08-02 08:44:12 | [diff] [blame] | 42 | |
43 | bool HandleNotificationClickedDelegate::HasClickedListener() { | ||||
44 | return !closure_.is_null(); | ||||
45 | } | ||||
46 | |||||
47 | void HandleNotificationClickedDelegate::Click() { | ||||
[email protected] | 846d621 | 2014-02-06 01:53:47 | [diff] [blame] | 48 | if (!closure_.is_null()) |
49 | closure_.Run(); | ||||
[email protected] | 120a0dd | 2013-08-02 08:44:12 | [diff] [blame] | 50 | } |
51 | |||||
[email protected] | 657116e | 2014-04-09 14:10:16 | [diff] [blame] | 52 | // HandleNotificationButtonClickDelegate: |
53 | |||||
54 | HandleNotificationButtonClickDelegate::HandleNotificationButtonClickDelegate( | ||||
55 | const ButtonClickCallback& button_callback) | ||||
56 | : button_callback_(button_callback) { | ||||
57 | } | ||||
58 | |||||
59 | HandleNotificationButtonClickDelegate:: | ||||
peter | cf29ede8 | 2014-10-30 23:19:19 | [diff] [blame] | 60 | ~HandleNotificationButtonClickDelegate() {} |
[email protected] | 657116e | 2014-04-09 14:10:16 | [diff] [blame] | 61 | |
62 | void HandleNotificationButtonClickDelegate::ButtonClick(int button_index) { | ||||
63 | if (!button_callback_.is_null()) | ||||
64 | button_callback_.Run(button_index); | ||||
65 | } | ||||
66 | |||||
bmalcolm | 4607efe | 2016-09-19 19:42:16 | [diff] [blame] | 67 | bool NotificationDelegate::ShouldDisplayOverFullscreen() const { |
68 | return false; | ||||
69 | } | ||||
70 | |||||
[email protected] | 7fde24af7 | 2013-05-28 17:19:03 | [diff] [blame] | 71 | } // namespace message_center |