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

Unified Diff: chrome/browser/extensions/extension_gcm_app_handler.cc

Issue 286213003: Make GCMProfileService own GCMDriver, instead of deriving from it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 6 years, 7 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
Index: chrome/browser/extensions/extension_gcm_app_handler.cc
diff --git a/chrome/browser/extensions/extension_gcm_app_handler.cc b/chrome/browser/extensions/extension_gcm_app_handler.cc
index 879a351afddd924fb61e6975735ab9fc835fc405..505271aeeaeb2039ae2b301930aea793c2aeba57 100644
--- a/chrome/browser/extensions/extension_gcm_app_handler.cc
+++ b/chrome/browser/extensions/extension_gcm_app_handler.cc
@@ -9,6 +9,7 @@
#include "base/location.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/services/gcm/gcm_driver.h"
#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
#include "content/public/browser/notification_details.h"
@@ -63,7 +64,7 @@ ExtensionGCMAppHandler::~ExtensionGCMAppHandler() {
extension != enabled_extensions.end();
++extension) {
if (IsGCMPermissionEnabled(extension->get()))
- GetGCMProfileService()->RemoveAppHandler((*extension)->id());
+ GetGCMDriver()->RemoveAppHandler((*extension)->id());
}
}
@@ -99,7 +100,7 @@ void ExtensionGCMAppHandler::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) {
if (IsGCMPermissionEnabled(extension))
- GetGCMProfileService()->AddAppHandler(extension->id(), this);
+ GetGCMDriver()->AddAppHandler(extension->id(), this);
}
void ExtensionGCMAppHandler::OnExtensionUnloaded(
@@ -107,7 +108,7 @@ void ExtensionGCMAppHandler::OnExtensionUnloaded(
const Extension* extension,
UnloadedExtensionInfo::Reason reason) {
if (IsGCMPermissionEnabled(extension))
- GetGCMProfileService()->RemoveAppHandler(extension->id());
+ GetGCMDriver()->RemoveAppHandler(extension->id());
}
void ExtensionGCMAppHandler::Observe(
@@ -117,17 +118,17 @@ void ExtensionGCMAppHandler::Observe(
DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNINSTALLED, type);
const Extension* extension = content::Details<Extension>(details).ptr();
if (IsGCMPermissionEnabled(extension)) {
- GetGCMProfileService()->Unregister(
+ GetGCMDriver()->Unregister(
extension->id(),
base::Bind(&ExtensionGCMAppHandler::OnUnregisterCompleted,
weak_factory_.GetWeakPtr(),
extension->id()));
- GetGCMProfileService()->RemoveAppHandler(extension->id());
+ GetGCMDriver()->RemoveAppHandler(extension->id());
}
}
-gcm::GCMProfileService* ExtensionGCMAppHandler::GetGCMProfileService() const {
- return gcm::GCMProfileServiceFactory::GetForProfile(profile_);
+gcm::GCMDriver* ExtensionGCMAppHandler::GetGCMDriver() const {
+ return gcm::GCMProfileServiceFactory::GetForProfile(profile_)->driver();
}
void ExtensionGCMAppHandler::OnUnregisterCompleted(
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.h ('k') | chrome/browser/extensions/extension_gcm_app_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698