Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / message_center / notification_delegate.cc
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
7 namespace message_center {
8
9 // NotificationDelegate:
10
11 void NotificationDelegate::Display() {}
12
13 void NotificationDelegate::Close(bool by_user) {}
14
15 bool NotificationDelegate::HasClickedListener() { return false; }
16
17 void NotificationDelegate::Click() {}
18
19 void NotificationDelegate::ButtonClick(int button_index) {}
20
21 // HandleNotificationClickedDelegate:
22
23 HandleNotificationClickedDelegate::HandleNotificationClickedDelegate(
24     const base::Closure& closure)
25     : closure_(closure) {
26 }
27
28 HandleNotificationClickedDelegate::~HandleNotificationClickedDelegate() {}
29
30 bool HandleNotificationClickedDelegate::HasClickedListener() {
31   return !closure_.is_null();
32 }
33
34 void HandleNotificationClickedDelegate::Click() {
35   if (!closure_.is_null())
36     closure_.Run();
37 }
38
39 // HandleNotificationButtonClickDelegate:
40
41 HandleNotificationButtonClickDelegate::HandleNotificationButtonClickDelegate(
42     const ButtonClickCallback& button_callback)
43     : button_callback_(button_callback) {
44 }
45
46 HandleNotificationButtonClickDelegate::
47     ~HandleNotificationButtonClickDelegate() {}
48
49 void HandleNotificationButtonClickDelegate::ButtonClick(int button_index) {
50   if (!button_callback_.is_null())
51     button_callback_.Run(button_index);
52 }
53
54 }  // namespace message_center