| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_handler.h" | 5 #include "chrome/browser/notifications/persistent_notification_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 8 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 | 10 |
| 11 PersistentNotificationHandler::PersistentNotificationHandler() {} | 11 PersistentNotificationHandler::PersistentNotificationHandler() {} |
| 12 PersistentNotificationHandler::~PersistentNotificationHandler() {} | 12 PersistentNotificationHandler::~PersistentNotificationHandler() {} |
| 13 | 13 |
| 14 void PersistentNotificationHandler::OnShow(Profile* profile, |
| 15 const std::string& notification_id) { |
| 16 } |
| 17 |
| 14 void PersistentNotificationHandler::OnClose(Profile* profile, | 18 void PersistentNotificationHandler::OnClose(Profile* profile, |
| 15 const std::string& origin, | 19 const std::string& origin, |
| 16 const std::string& notification_id, | 20 const std::string& notification_id, |
| 17 bool by_user) { | 21 bool by_user) { |
| 18 if (!by_user) | 22 if (!by_user) |
| 19 return; // no need to propagate back programmatic close events | 23 return; // no need to propagate back programmatic close events |
| 20 | 24 |
| 21 const GURL notification_origin(origin); | 25 const GURL notification_origin(origin); |
| 22 DCHECK(notification_origin.is_valid()); | 26 DCHECK(notification_origin.is_valid()); |
| 23 | 27 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 34 const GURL notification_origin(origin); | 38 const GURL notification_origin(origin); |
| 35 DCHECK(notification_origin.is_valid()); | 39 DCHECK(notification_origin.is_valid()); |
| 36 | 40 |
| 37 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( | 41 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( |
| 38 profile, notification_id, notification_origin, action_index, reply); | 42 profile, notification_id, notification_origin, action_index, reply); |
| 39 } | 43 } |
| 40 | 44 |
| 41 void PersistentNotificationHandler::OpenSettings(Profile* profile) { | 45 void PersistentNotificationHandler::OpenSettings(Profile* profile) { |
| 42 NotificationCommon::OpenNotificationSettings(profile); | 46 NotificationCommon::OpenNotificationSettings(profile); |
| 43 } | 47 } |
| OLD | NEW |