summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/api/copresence/copresence_api.cc7
-rw-r--r--chrome/browser/extensions/api/copresence/copresence_api.h5
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/extensions/api/copresence/copresence_api.cc b/chrome/browser/extensions/api/copresence/copresence_api.cc
index 7e91674..f4ae23e 100644
--- a/chrome/browser/extensions/api/copresence/copresence_api.cc
+++ b/chrome/browser/extensions/api/copresence/copresence_api.cc
@@ -7,6 +7,8 @@
#include "base/lazy_instance.h"
#include "base/memory/linked_ptr.h"
#include "chrome/browser/copresence/chrome_whispernet_client.h"
+#include "chrome/browser/services/gcm/gcm_profile_service.h"
+#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/api/copresence.h"
#include "components/copresence/copresence_manager_impl.h"
@@ -145,6 +147,11 @@ copresence::WhispernetClient* CopresenceService::GetWhispernetClient() {
return whispernet_client();
}
+gcm::GCMDriver* CopresenceService::GetGCMDriver() {
+ return gcm::GCMProfileServiceFactory::GetForProfile(browser_context_)
+ ->driver();
+}
+
template <>
void
BrowserContextKeyedAPIFactory<CopresenceService>::DeclareFactoryDependencies() {
diff --git a/chrome/browser/extensions/api/copresence/copresence_api.h b/chrome/browser/extensions/api/copresence/copresence_api.h
index b7103cf..d49c878 100644
--- a/chrome/browser/extensions/api/copresence/copresence_api.h
+++ b/chrome/browser/extensions/api/copresence/copresence_api.h
@@ -24,6 +24,10 @@ class CopresenceManager;
class WhispernetClient;
}
+namespace gcm {
+class GCMDriver;
+}
+
namespace extensions {
class CopresenceService : public BrowserContextKeyedAPI,
@@ -73,6 +77,7 @@ class CopresenceService : public BrowserContextKeyedAPI,
const std::string GetPlatformVersionString() const override;
const std::string GetAPIKey(const std::string& app_id) const override;
copresence::WhispernetClient* GetWhispernetClient() override;
+ gcm::GCMDriver* GetGCMDriver() override;
// BrowserContextKeyedAPI implementation.
static const char* service_name() { return "CopresenceService"; }