| Index: chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| index 9c7e3835dd752423334e73e042da91065536777a..973b04ceaae68e2505cd608e77e14c2b5ea89086 100644
|
| --- a/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| +++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
|
| @@ -19,6 +19,7 @@
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "build/build_config.h"
|
| #include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
| #include "chrome/browser/gcm/gcm_profile_service_factory.h"
|
| #include "chrome/browser/gcm/instance_id/instance_id_profile_service.h"
|
| @@ -46,6 +47,7 @@
|
| #include "components/rappor/public/rappor_utils.h"
|
| #include "components/rappor/rappor_service_impl.h"
|
| #include "content/public/browser/browser_context.h"
|
| +#include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/render_frame_host.h"
|
| #include "content/public/browser/service_worker_context.h"
|
| #include "content/public/browser/storage_partition.h"
|
| @@ -161,12 +163,33 @@ PushMessagingServiceImpl::PushMessagingServiceImpl(Profile* profile)
|
| weak_factory_(this) {
|
| DCHECK(profile);
|
| HostContentSettingsMapFactory::GetForProfile(profile_)->AddObserver(this);
|
| +
|
| + registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
|
| + content::NotificationService::AllSources());
|
| + registrar_.Add(this, chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
|
| + content::NotificationService::AllSources());
|
| }
|
|
|
| PushMessagingServiceImpl::~PushMessagingServiceImpl() {
|
| HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver(this);
|
| }
|
|
|
| +void PushMessagingServiceImpl::Observe(
|
| + int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) {
|
| + switch (type) {
|
| + case chrome::NOTIFICATION_APP_TERMINATING: {
|
| + DVLOG(1) << "PushMessagingServiceImpl Terminating";
|
| + break;
|
| + }
|
| + case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: {
|
| + DVLOG(1) << "PushMessagingServiceImpl Close All Browsers Request";
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +
|
| void PushMessagingServiceImpl::IncreasePushSubscriptionCount(int add,
|
| bool is_pending) {
|
| DCHECK(add > 0);
|
|
|