OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/notifications/persistent_notification_delegate.h" | 5 #include "chrome/browser/notifications/persistent_notification_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 9 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
10 #include "content/public/common/persistent_notification_status.h" | 10 #include "content/public/common/persistent_notification_status.h" |
11 | 11 |
12 PersistentNotificationDelegate::PersistentNotificationDelegate( | 12 PersistentNotificationDelegate::PersistentNotificationDelegate( |
13 content::BrowserContext* browser_context, | 13 content::BrowserContext* browser_context, |
14 int64_t persistent_notification_id, | 14 int64_t persistent_notification_id, |
15 const GURL& origin) | 15 const GURL& origin) |
16 : browser_context_(browser_context), | 16 : browser_context_(browser_context), |
17 persistent_notification_id_(persistent_notification_id), | 17 persistent_notification_id_(persistent_notification_id), |
18 origin_(origin), | 18 origin_(origin), |
19 id_(base::GenerateGUID()) {} | 19 id_(base::GenerateGUID()) {} |
20 | 20 |
21 PersistentNotificationDelegate::~PersistentNotificationDelegate() {} | 21 PersistentNotificationDelegate::~PersistentNotificationDelegate() {} |
22 | 22 |
23 void PersistentNotificationDelegate::Display() {} | 23 void PersistentNotificationDelegate::Display() {} |
24 | 24 |
25 void PersistentNotificationDelegate::Close(bool by_user) {} | 25 void PersistentNotificationDelegate::Close(bool by_user) { |
| 26 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose( |
| 27 browser_context_, |
| 28 persistent_notification_id_, |
| 29 origin_); |
| 30 } |
26 | 31 |
27 void PersistentNotificationDelegate::Click() { | 32 void PersistentNotificationDelegate::Click() { |
28 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( | 33 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( |
29 browser_context_, | 34 browser_context_, |
30 persistent_notification_id_, | 35 persistent_notification_id_, |
31 origin_); | 36 origin_); |
32 } | 37 } |
33 | 38 |
34 std::string PersistentNotificationDelegate::id() const { | 39 std::string PersistentNotificationDelegate::id() const { |
35 return id_; | 40 return id_; |
36 } | 41 } |
OLD | NEW |