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