Chromium Code Reviews| Index: chrome/browser/notifications/persistent_notification_delegate.cc |
| diff --git a/chrome/browser/notifications/persistent_notification_delegate.cc b/chrome/browser/notifications/persistent_notification_delegate.cc |
| index bf1516d6734008eb53b6891b1a24997854185e84..cf214b519f73d3a44f2ba161de2d6bc40aa0426f 100644 |
| --- a/chrome/browser/notifications/persistent_notification_delegate.cc |
| +++ b/chrome/browser/notifications/persistent_notification_delegate.cc |
| @@ -5,15 +5,22 @@ |
| #include "chrome/browser/notifications/persistent_notification_delegate.h" |
| #include "chrome/browser/notifications/platform_notification_service_impl.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/ui/browser.h" |
| +#include "chrome/browser/ui/browser_list.h" |
| +#include "chrome/browser/ui/browser_window.h" |
| +#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| +#include "chrome/browser/ui/tabs/tab_strip_model.h" |
| +#include "content/public/browser/web_contents.h" |
|
Peter Beverloo
2016/09/27 17:17:36
nit: these includes probably aren't needed for thi
bmalcolm
2016/09/27 20:34:36
Earlier design. Removed.
|
| + |
| +using content::WebContents; |
|
Peter Beverloo
2016/09/27 17:17:36
unused
bmalcolm
2016/09/27 20:34:36
Removed.
|
| PersistentNotificationDelegate::PersistentNotificationDelegate( |
| content::BrowserContext* browser_context, |
| const std::string& notification_id, |
| const GURL& origin, |
| int notification_settings_index) |
| - : browser_context_(browser_context), |
| - notification_id_(notification_id), |
| - origin_(origin), |
| + : WebNotificationDelegate(browser_context, notification_id, origin), |
| notification_settings_index_(notification_settings_index) {} |
| PersistentNotificationDelegate::~PersistentNotificationDelegate() {} |
| @@ -22,33 +29,21 @@ void PersistentNotificationDelegate::Display() {} |
| void PersistentNotificationDelegate::Close(bool by_user) { |
| PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose( |
| - browser_context_, notification_id_, origin_, by_user); |
| + browser_context(), id(), origin(), by_user); |
| } |
| void PersistentNotificationDelegate::Click() { |
| PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( |
| - browser_context_, notification_id_, origin_, -1 /* action_index */); |
| + browser_context(), id(), origin(), -1 /* action_index */); |
| } |
| void PersistentNotificationDelegate::ButtonClick(int button_index) { |
| DCHECK_GE(button_index, 0); |
| if (button_index == notification_settings_index_) { |
| - NotificationCommon::OpenNotificationSettings(browser_context_); |
| + NotificationCommon::OpenNotificationSettings(browser_context()); |
| return; |
| } |
| PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( |
| - browser_context_, notification_id_, origin_, button_index); |
| -} |
| - |
| -void PersistentNotificationDelegate::SettingsClick() { |
| - NotificationCommon::OpenNotificationSettings(browser_context_); |
| -} |
| - |
| -bool PersistentNotificationDelegate::ShouldDisplaySettingsButton() { |
| - return true; |
| -} |
| - |
| -std::string PersistentNotificationDelegate::id() const { |
| - return notification_id_; |
| + browser_context(), id(), origin(), button_index); |
| } |