Index: chrome/browser/chrome_content_browser_client.cc |
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
index fabdf6e144d3c5503363a7ef2ee6d901bed6a880..831b06cbd57825900f30285d098737a5fc2522f7 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -107,6 +107,7 @@ |
#include "components/nacl/common/nacl_switches.h" |
#include "components/translate/core/common/translate_switches.h" |
#include "components/user_prefs/pref_registry_syncable.h" |
+#include "content/browser/renderer_host/render_process_host_impl.h" |
#include "content/public/browser/browser_child_process_host.h" |
#include "content/public/browser/browser_main_parts.h" |
#include "content/public/browser/browser_ppapi_host.h" |
@@ -174,6 +175,7 @@ |
#elif defined(OS_LINUX) |
#include "chrome/browser/chrome_browser_main_linux.h" |
#elif defined(OS_ANDROID) |
+#include "chrome/browser/android/gcm_android.h" |
#include "chrome/browser/android/new_tab_page_url_handler.h" |
#include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
#include "chrome/browser/chrome_browser_main_android.h" |
@@ -2222,11 +2224,20 @@ content::SpeechRecognitionManagerDelegate* |
#endif |
} |
+// FIXME: When this returns an instance of GcmPlatformImplAndroid, this DOES NOT |
+// transfer ownership, but when it returns an instance of |
+// PushMessagingServiceImpl, it DOES transfer ownership. Aggh! |
content::PushMessagingService* |
ChromeContentBrowserClient::CreatePushMessagingService( |
- content::BrowserContext* browser_context) { |
+ content::RenderProcessHostImpl* rphi) { |
+#if defined(OS_ANDROID) |
+ GcmPlatformImplAndroid* gcm = GcmPlatformImplAndroid::GetInstance(); |
+ gcm->SetObserver(rphi->push_messaging_message_filter()); |
+ return gcm; |
+#else |
return new PushMessagingServiceImpl( |
- Profile::FromBrowserContext(browser_context)); |
+ Profile::FromBrowserContext(rphi->->GetBrowserContext())); |
+#endif |
} |
net::NetLog* ChromeContentBrowserClient::GetNetLog() { |