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 void WebNotificationDelegate::SettingsClick() { | 45 bool WebNotificationDelegate::SettingsClick() { |
| 46 #if !defined(OS_CHROMEOS) |
46 NotificationCommon::OpenNotificationSettings(browser_context_); | 47 NotificationCommon::OpenNotificationSettings(browser_context_); |
| 48 return true; |
| 49 #else |
| 50 return false; |
| 51 #endif |
47 } | 52 } |
48 | 53 |
49 bool WebNotificationDelegate::ShouldDisplaySettingsButton() { | 54 bool WebNotificationDelegate::ShouldDisplaySettingsButton() { |
50 return true; | 55 return true; |
51 } | 56 } |
52 | 57 |
53 bool WebNotificationDelegate::ShouldDisplayOverFullscreen() const { | 58 bool WebNotificationDelegate::ShouldDisplayOverFullscreen() const { |
54 #if !defined(OS_ANDROID) | 59 #if !defined(OS_ANDROID) |
55 Profile* profile = Profile::FromBrowserContext(browser_context_); | 60 Profile* profile = Profile::FromBrowserContext(browser_context_); |
56 DCHECK(profile); | 61 DCHECK(profile); |
(...skipping 29 matching lines...) Expand all Loading... |
86 NotifierId::WEB_PAGE, | 91 NotifierId::WEB_PAGE, |
87 NotifierId::SIZE); | 92 NotifierId::SIZE); |
88 } | 93 } |
89 return enabled; | 94 return enabled; |
90 } | 95 } |
91 } | 96 } |
92 #endif | 97 #endif |
93 | 98 |
94 return false; | 99 return false; |
95 } | 100 } |
OLD | NEW |