| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const GURL& origin) | 23 const GURL& origin) |
| 24 : browser_context_(browser_context), | 24 : browser_context_(browser_context), |
| 25 persistent_notification_id_(persistent_notification_id), | 25 persistent_notification_id_(persistent_notification_id), |
| 26 origin_(origin), | 26 origin_(origin), |
| 27 id_(base::GenerateGUID()) {} | 27 id_(base::GenerateGUID()) {} |
| 28 | 28 |
| 29 PersistentNotificationDelegate::~PersistentNotificationDelegate() {} | 29 PersistentNotificationDelegate::~PersistentNotificationDelegate() {} |
| 30 | 30 |
| 31 void PersistentNotificationDelegate::Display() {} | 31 void PersistentNotificationDelegate::Display() {} |
| 32 | 32 |
| 33 void PersistentNotificationDelegate::Close(bool by_user) {} | 33 void PersistentNotificationDelegate::Close(bool by_user) { |
| 34 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose( |
| 35 browser_context_, |
| 36 persistent_notification_id_, |
| 37 origin_); |
| 38 } |
| 34 | 39 |
| 35 void PersistentNotificationDelegate::Click() { | 40 void PersistentNotificationDelegate::Click() { |
| 36 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( | 41 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( |
| 37 browser_context_, | 42 browser_context_, |
| 38 persistent_notification_id_, | 43 persistent_notification_id_, |
| 39 origin_, | 44 origin_, |
| 40 base::Bind(&OnEventDispatchComplete)); | 45 base::Bind(&OnEventDispatchComplete)); |
| 41 } | 46 } |
| 42 | 47 |
| 43 std::string PersistentNotificationDelegate::id() const { | 48 std::string PersistentNotificationDelegate::id() const { |
| 44 return id_; | 49 return id_; |
| 45 } | 50 } |
| OLD | NEW |