Index: components/gcm_driver/gcm_profile_service.h |
diff --git a/chrome/browser/services/gcm/gcm_profile_service.h b/components/gcm_driver/gcm_profile_service.h |
similarity index 50% |
rename from chrome/browser/services/gcm/gcm_profile_service.h |
rename to components/gcm_driver/gcm_profile_service.h |
index 7eba5eafd5cdb9f70117f4bc2f793f94b8d38aa9..ad3c43d2afe613c488e5496244cd2a9818b3121a 100644 |
--- a/chrome/browser/services/gcm/gcm_profile_service.h |
+++ b/components/gcm_driver/gcm_profile_service.h |
@@ -8,10 +8,16 @@ |
#include <string> |
#include "base/compiler_specific.h" |
+#include "base/files/file_path.h" |
#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
#include "components/keyed_service/core/keyed_service.h" |
+#include "components/signin/core/browser/profile_oauth2_token_service.h" |
droger
2015/10/27 12:23:44
Can we forward declare
ProfileOAuth2TokenService
i
Jitu( very slow this week)
2015/10/28 05:11:36
Done.
|
+#include "components/signin/core/browser/signin_manager_base.h" |
+#include "components/version_info/version_info.h" |
+#include "net/url_request/url_request_context_getter.h" |
+class PrefService; |
class Profile; |
droger
2015/10/27 12:23:44
Remove Profile, here and in comments below (lines
Jitu( very slow this week)
2015/10/28 05:11:36
Done.
|
namespace user_prefs { |
@@ -31,13 +37,25 @@ class GCMConnectionObserver; |
class GCMProfileService : public KeyedService { |
public: |
// Returns whether GCM is enabled for |profile|. |
- static bool IsGCMEnabled(Profile* profile); |
+ static bool IsGCMEnabled(PrefService* prefs); |
#if defined(OS_ANDROID) |
- explicit GCMProfileService(Profile* profile); |
+ explicit GCMProfileService( |
+ base::FilePath path, |
+ const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); |
#else |
- GCMProfileService(Profile* profile, |
- scoped_ptr<GCMClientFactory> gcm_client_factory); |
+ GCMProfileService( |
+ PrefService* prefs, |
+ base::FilePath path, |
+ net::URLRequestContextGetter* request_context, |
+ version_info::Channel channel, |
+ SigninManagerBase* signin_manager, |
+ ProfileOAuth2TokenService* profile_o_auth_2_token_service, |
+ const base::Closure& login_callback, |
+ scoped_ptr<GCMClientFactory> gcm_client_factory, |
+ const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner, |
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
+ const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); |
#endif |
~GCMProfileService() override; |
@@ -45,7 +63,8 @@ class GCMProfileService : public KeyedService { |
void Shutdown() override; |
// For testing purpose. |
- void SetDriverForTesting(GCMDriver* driver); |
+ void SetDriverForTesting(const base::Closure& login_callback, |
+ GCMDriver* driver); |
GCMDriver* driver() const { return driver_.get(); } |
@@ -54,12 +73,13 @@ class GCMProfileService : public KeyedService { |
GCMProfileService(); |
private: |
- // The profile which owns this object. |
- Profile* profile_; |
+ SigninManagerBase* signin_manager_; |
+ ProfileOAuth2TokenService* profile_o_auth_2_token_service_; |
+ net::URLRequestContextGetter* request_context_; |
scoped_ptr<GCMDriver> driver_; |
- // Used for both account tracker and GCM.UserSignedIn UMA. |
+// Used for both account tracker and GCM.UserSignedIn UMA. |
#if !defined(OS_ANDROID) |
class IdentityObserver; |
scoped_ptr<IdentityObserver> identity_observer_; |