Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 237323002: [NOT FOR REVIEW] Plumb Android GCM to Push API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698