| 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/web_notification_delegate.h" | 5 #include "chrome/browser/notifications/web_notification_delegate.h" |
| 6 | 6 |
| 7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "chrome/browser/notifications/notification_common.h" | 9 #include "chrome/browser/notifications/notification_common.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 : browser_context_(browser_context), | 35 : browser_context_(browser_context), |
| 36 notification_id_(notification_id), | 36 notification_id_(notification_id), |
| 37 origin_(origin) {} | 37 origin_(origin) {} |
| 38 | 38 |
| 39 WebNotificationDelegate::~WebNotificationDelegate() {} | 39 WebNotificationDelegate::~WebNotificationDelegate() {} |
| 40 | 40 |
| 41 std::string WebNotificationDelegate::id() const { | 41 std::string WebNotificationDelegate::id() const { |
| 42 return notification_id_; | 42 return notification_id_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool WebNotificationDelegate::SettingsClick() { | 45 void WebNotificationDelegate::SettingsClick() { |
| 46 #if !defined(OS_CHROMEOS) | |
| 47 NotificationCommon::OpenNotificationSettings(browser_context_); | 46 NotificationCommon::OpenNotificationSettings(browser_context_); |
| 48 return true; | |
| 49 #else | |
| 50 return false; | |
| 51 #endif | |
| 52 } | 47 } |
| 53 | 48 |
| 54 bool WebNotificationDelegate::ShouldDisplaySettingsButton() { | 49 bool WebNotificationDelegate::ShouldDisplaySettingsButton() { |
| 55 return true; | 50 return true; |
| 56 } | 51 } |
| 57 | 52 |
| 58 bool WebNotificationDelegate::ShouldDisplayOverFullscreen() const { | 53 bool WebNotificationDelegate::ShouldDisplayOverFullscreen() const { |
| 59 #if !defined(OS_ANDROID) | 54 #if !defined(OS_ANDROID) |
| 60 Profile* profile = Profile::FromBrowserContext(browser_context_); | 55 Profile* profile = Profile::FromBrowserContext(browser_context_); |
| 61 DCHECK(profile); | 56 DCHECK(profile); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 NotifierId::WEB_PAGE, | 86 NotifierId::WEB_PAGE, |
| 92 NotifierId::SIZE); | 87 NotifierId::SIZE); |
| 93 } | 88 } |
| 94 return enabled; | 89 return enabled; |
| 95 } | 90 } |
| 96 } | 91 } |
| 97 #endif | 92 #endif |
| 98 | 93 |
| 99 return false; | 94 return false; |
| 100 } | 95 } |
| OLD | NEW |