OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/public/browser/push_messaging_service.h" | 5 #include "content/public/browser/push_messaging_service.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "content/browser/push_messaging/push_messaging_message_filter.h" | 8 #include "content/browser/push_messaging/push_messaging_message_filter.h" |
9 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 9 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 BrowserContext* browser_context, const GURL& origin) { | 83 BrowserContext* browser_context, const GURL& origin) { |
84 StoragePartition* partition = | 84 StoragePartition* partition = |
85 BrowserContext::GetStoragePartitionForSite(browser_context, origin); | 85 BrowserContext::GetStoragePartitionForSite(browser_context, origin); |
86 return make_scoped_refptr( | 86 return make_scoped_refptr( |
87 static_cast<ServiceWorkerContextWrapper*>( | 87 static_cast<ServiceWorkerContextWrapper*>( |
88 partition->GetServiceWorkerContext())); | 88 partition->GetServiceWorkerContext())); |
89 } | 89 } |
90 | 90 |
91 } // anonymous namespace | 91 } // anonymous namespace |
92 | 92 |
| 93 bool PushMessagingService::SupportNonVisibleMessages() { |
| 94 return false; |
| 95 } |
| 96 |
93 // static | 97 // static |
94 void PushMessagingService::GetNotificationsShownByLastFewPushes( | 98 void PushMessagingService::GetNotificationsShownByLastFewPushes( |
95 ServiceWorkerContext* service_worker_context, | 99 ServiceWorkerContext* service_worker_context, |
96 int64 service_worker_registration_id, | 100 int64 service_worker_registration_id, |
97 const StringCallback& callback) { | 101 const StringCallback& callback) { |
98 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 102 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
99 scoped_refptr<ServiceWorkerContextWrapper> wrapper = | 103 scoped_refptr<ServiceWorkerContextWrapper> wrapper = |
100 static_cast<ServiceWorkerContextWrapper*>(service_worker_context); | 104 static_cast<ServiceWorkerContextWrapper*>(service_worker_context); |
101 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 105 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
102 base::Bind(&GetUserDataOnIO, | 106 base::Bind(&GetUserDataOnIO, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 BrowserThread::PostTask( | 155 BrowserThread::PostTask( |
152 BrowserThread::IO, | 156 BrowserThread::IO, |
153 FROM_HERE, | 157 FROM_HERE, |
154 base::Bind(&ClearPushRegistrationIDOnIO, | 158 base::Bind(&ClearPushRegistrationIDOnIO, |
155 GetServiceWorkerContext(browser_context, origin), | 159 GetServiceWorkerContext(browser_context, origin), |
156 service_worker_registration_id, | 160 service_worker_registration_id, |
157 callback)); | 161 callback)); |
158 } | 162 } |
159 | 163 |
160 } // namespace content | 164 } // namespace content |
OLD | NEW |