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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.h

Issue 286213003: Make GCMProfileService own GCMDriver, instead of deriving from it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots 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/services/gcm/gcm_profile_service.h
diff --git a/chrome/browser/services/gcm/gcm_profile_service.h b/chrome/browser/services/gcm/gcm_profile_service.h
index 69f346f007455b7a0704493c45df930cb45557d1..bd1ccae5507ee4616090e92a091b5ddb610a726a 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.h
+++ b/chrome/browser/services/gcm/gcm_profile_service.h
@@ -10,7 +10,6 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/services/gcm/gcm_driver.h"
#include "components/keyed_service/core/keyed_service.h"
class Profile;
@@ -21,8 +20,11 @@ class PrefRegistrySyncable;
namespace gcm {
-// A specialization of GCMDriver that is tied to a Profile.
-class GCMProfileService : public GCMDriver, public KeyedService {
+class GCMClientFactory;
+class GCMDriver;
+
+// Providing GCM service, via GCMDriver, to a profile.
+class GCMProfileService : public KeyedService {
public:
// Any change made to this enum should have corresponding change in the
// GetGCMEnabledStateString(...) function.
@@ -48,23 +50,22 @@ class GCMProfileService : public GCMDriver, public KeyedService {
explicit GCMProfileService(Profile* profile);
virtual ~GCMProfileService();
+ void Initialize(scoped_ptr<GCMClientFactory> gcm_client_factory);
+
// KeyedService:
virtual void Shutdown() OVERRIDE;
- // Returns the user name if the profile is signed in.
- std::string SignedInUserName() const;
+ // For testing purpose.
+ void SetDriverForTesting(GCMDriver* driver);
- protected:
- // Overridden from GCMDriver:
- virtual bool ShouldStartAutomatically() const OVERRIDE;
- virtual base::FilePath GetStorePath() const OVERRIDE;
- virtual scoped_refptr<net::URLRequestContextGetter>
- GetURLRequestContextGetter() const OVERRIDE;
+ GCMDriver* driver() const { return driver_.get(); }
Nicolas Zea 2014/05/19 21:04:06 I'm a bit concerned about the possibility of other
jianli 2014/05/19 23:03:48 Moved Initialize logic into constructor.
private:
// The profile which owns this object.
Profile* profile_;
+ scoped_ptr<GCMDriver> driver_;
+
DISALLOW_COPY_AND_ASSIGN(GCMProfileService);
};

Powered by Google App Engine
This is Rietveld 408576698