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 CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
6 #define CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/services/gcm/push_messaging_service_impl.h" |
13 // TODO(jianli): include needed for obsolete methods that are going to be | 14 // TODO(jianli): include needed for obsolete methods that are going to be |
14 // removed soon. | 15 // removed soon. |
15 #include "components/gcm_driver/gcm_driver.h" | 16 #include "components/gcm_driver/gcm_driver.h" |
16 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
17 | 18 |
18 class Profile; | 19 class Profile; |
19 | 20 |
20 namespace user_prefs { | 21 namespace user_prefs { |
21 class PrefRegistrySyncable; | 22 class PrefRegistrySyncable; |
22 } | 23 } |
(...skipping 28 matching lines...) Expand all Loading... |
51 const GCMDriver::RegisterCallback& callback); | 52 const GCMDriver::RegisterCallback& callback); |
52 | 53 |
53 // KeyedService: | 54 // KeyedService: |
54 virtual void Shutdown() OVERRIDE; | 55 virtual void Shutdown() OVERRIDE; |
55 | 56 |
56 // For testing purpose. | 57 // For testing purpose. |
57 void SetDriverForTesting(GCMDriver* driver); | 58 void SetDriverForTesting(GCMDriver* driver); |
58 | 59 |
59 GCMDriver* driver() const { return driver_.get(); } | 60 GCMDriver* driver() const { return driver_.get(); } |
60 | 61 |
| 62 content::PushMessagingService* push_messaging_service() { |
| 63 return &push_messaging_service_; |
| 64 } |
| 65 |
61 protected: | 66 protected: |
62 // Used for constructing fake GCMProfileService for testing purpose. | 67 // Used for constructing fake GCMProfileService for testing purpose. |
63 GCMProfileService(); | 68 GCMProfileService(); |
64 | 69 |
65 private: | 70 private: |
66 // The profile which owns this object. | 71 // The profile which owns this object. |
67 Profile* profile_; | 72 Profile* profile_; |
68 | 73 |
69 scoped_ptr<GCMDriver> driver_; | 74 scoped_ptr<GCMDriver> driver_; |
70 | 75 |
| 76 // Implementation of content::PushMessagingService using GCMProfileService. |
| 77 PushMessagingServiceImpl push_messaging_service_; |
| 78 |
71 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); | 79 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
72 }; | 80 }; |
73 | 81 |
74 } // namespace gcm | 82 } // namespace gcm |
75 | 83 |
76 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 84 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
OLD | NEW |