OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_GCM_DRIVER_GCM_PROFILE_SERVICE_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_PROFILE_SERVICE_H_ |
6 #define COMPONENTS_GCM_DRIVER_GCM_PROFILE_SERVICE_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_PROFILE_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "components/gcm_driver/gcm_build_features.h" | 17 #include "components/gcm_driver/gcm_build_features.h" |
18 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
19 #include "components/signin/core/browser/profile_identity_provider.h" | 19 #include "components/signin/core/browser/profile_identity_provider.h" |
20 #include "components/version_info/version_info.h" | 20 #include "components/version_info/version_info.h" |
21 | 21 |
22 class PrefService; | 22 class PrefService; |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 class SequencedTaskRunner; | 25 class SequencedTaskRunner; |
26 } | 26 } |
27 | 27 |
| 28 namespace instance_id { |
| 29 class InstanceIDFactory; |
| 30 } |
| 31 |
28 namespace net { | 32 namespace net { |
29 class URLRequestContextGetter; | 33 class URLRequestContextGetter; |
30 } | 34 } |
31 | 35 |
32 namespace gcm { | 36 namespace gcm { |
33 | 37 |
34 class GCMClientFactory; | 38 class GCMClientFactory; |
35 class GCMDriver; | 39 class GCMDriver; |
36 | 40 |
37 // Providing GCM service, via GCMDriver. | 41 // Providing GCM service, via GCMDriver. |
(...skipping 22 matching lines...) Expand all Loading... |
60 static bool IsGCMEnabled(PrefService* prefs); | 64 static bool IsGCMEnabled(PrefService* prefs); |
61 | 65 |
62 // KeyedService: | 66 // KeyedService: |
63 void Shutdown() override; | 67 void Shutdown() override; |
64 | 68 |
65 // For testing purpose. | 69 // For testing purpose. |
66 void SetDriverForTesting(GCMDriver* driver); | 70 void SetDriverForTesting(GCMDriver* driver); |
67 | 71 |
68 GCMDriver* driver() const { return driver_.get(); } | 72 GCMDriver* driver() const { return driver_.get(); } |
69 | 73 |
| 74 instance_id::InstanceIDFactory* instance_id_factory() const { |
| 75 return instance_id_factory_.get(); |
| 76 } |
| 77 |
70 protected: | 78 protected: |
71 // Used for constructing fake GCMProfileService for testing purpose. | 79 // Used for constructing fake GCMProfileService for testing purpose. |
72 GCMProfileService(); | 80 GCMProfileService(); |
73 | 81 |
74 private: | 82 private: |
75 std::unique_ptr<ProfileIdentityProvider> profile_identity_provider_; | 83 std::unique_ptr<ProfileIdentityProvider> profile_identity_provider_; |
76 std::unique_ptr<GCMDriver> driver_; | 84 std::unique_ptr<GCMDriver> driver_; |
| 85 std::unique_ptr<instance_id::InstanceIDFactory> instance_id_factory_; |
77 | 86 |
78 #if !BUILDFLAG(USE_GCM_FROM_PLATFORM) | 87 #if !BUILDFLAG(USE_GCM_FROM_PLATFORM) |
79 net::URLRequestContextGetter* request_context_ = nullptr; | 88 net::URLRequestContextGetter* request_context_ = nullptr; |
80 | 89 |
81 // Used for both account tracker and GCM.UserSignedIn UMA. | 90 // Used for both account tracker and GCM.UserSignedIn UMA. |
82 class IdentityObserver; | 91 class IdentityObserver; |
83 std::unique_ptr<IdentityObserver> identity_observer_; | 92 std::unique_ptr<IdentityObserver> identity_observer_; |
84 #endif | 93 #endif |
85 | 94 |
86 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); | 95 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
87 }; | 96 }; |
88 | 97 |
89 } // namespace gcm | 98 } // namespace gcm |
90 | 99 |
91 #endif // COMPONENTS_GCM_DRIVER_GCM_PROFILE_SERVICE_H_ | 100 #endif // COMPONENTS_GCM_DRIVER_GCM_PROFILE_SERVICE_H_ |
92 | 101 |
OLD | NEW |