Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/push_messaging/push_messaging_service_impl.h" | 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 738 | 738 |
| 739 void PushMessagingServiceImpl::SetContentSettingChangedCallbackForTesting( | 739 void PushMessagingServiceImpl::SetContentSettingChangedCallbackForTesting( |
| 740 const base::Closure& callback) { | 740 const base::Closure& callback) { |
| 741 content_setting_changed_callback_for_testing_ = callback; | 741 content_setting_changed_callback_for_testing_ = callback; |
| 742 } | 742 } |
| 743 | 743 |
| 744 // KeyedService methods ------------------------------------------------------- | 744 // KeyedService methods ------------------------------------------------------- |
| 745 | 745 |
| 746 void PushMessagingServiceImpl::Shutdown() { | 746 void PushMessagingServiceImpl::Shutdown() { |
| 747 GetGCMDriver()->RemoveAppHandler(kPushMessagingAppIdentifierPrefix); | 747 GetGCMDriver()->RemoveAppHandler(kPushMessagingAppIdentifierPrefix); |
| 748 profile_->GetHostContentSettingsMap()->RemoveObserver(this); | 748 HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver(this); |
|
Peter Beverloo
2015/09/09 21:03:51
Shouldn't the PushMessagingServiceFactory declare
Bernhard Bauer
2015/09/10 09:30:44
Yes, that would be good.
PEConn
2015/09/11 12:57:26
PushMessagingServiceFactory already declares a dep
| |
| 749 #if defined(ENABLE_BACKGROUND) | 749 #if defined(ENABLE_BACKGROUND) |
| 750 // TODO(mvanouwerkerk): Ensure Push API unregisters correctly from Background | 750 // TODO(mvanouwerkerk): Ensure Push API unregisters correctly from Background |
| 751 // Mode - crbug.com/527036. | 751 // Mode - crbug.com/527036. |
| 752 if (UseBackgroundMode() && g_browser_process->background_mode_manager()) { | 752 if (UseBackgroundMode() && g_browser_process->background_mode_manager()) { |
| 753 g_browser_process->background_mode_manager()->UnregisterTrigger(profile_, | 753 g_browser_process->background_mode_manager()->UnregisterTrigger(profile_, |
| 754 this); | 754 this); |
| 755 } | 755 } |
| 756 #endif // defined(ENABLE_BACKGROUND) | 756 #endif // defined(ENABLE_BACKGROUND) |
| 757 } | 757 } |
| 758 | 758 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 787 switches::kEnablePushMessagePayload); | 787 switches::kEnablePushMessagePayload); |
| 788 } | 788 } |
| 789 | 789 |
| 790 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 790 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
| 791 gcm::GCMProfileService* gcm_profile_service = | 791 gcm::GCMProfileService* gcm_profile_service = |
| 792 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 792 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
| 793 CHECK(gcm_profile_service); | 793 CHECK(gcm_profile_service); |
| 794 CHECK(gcm_profile_service->driver()); | 794 CHECK(gcm_profile_service->driver()); |
| 795 return gcm_profile_service->driver(); | 795 return gcm_profile_service->driver(); |
| 796 } | 796 } |
| OLD | NEW |