| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 class PushMessagingAPI : public BrowserContextKeyedAPI, | 114 class PushMessagingAPI : public BrowserContextKeyedAPI, |
| 115 public content::NotificationObserver { | 115 public content::NotificationObserver { |
| 116 public: | 116 public: |
| 117 explicit PushMessagingAPI(content::BrowserContext* context); | 117 explicit PushMessagingAPI(content::BrowserContext* context); |
| 118 virtual ~PushMessagingAPI(); | 118 virtual ~PushMessagingAPI(); |
| 119 | 119 |
| 120 // Convenience method to get the PushMessagingAPI for a profile. | 120 // Convenience method to get the PushMessagingAPI for a profile. |
| 121 static PushMessagingAPI* Get(content::BrowserContext* context); | 121 static PushMessagingAPI* Get(content::BrowserContext* context); |
| 122 | 122 |
| 123 // BrowserContextKeyedService implementation. | 123 // KeyedService implementation. |
| 124 virtual void Shutdown() OVERRIDE; | 124 virtual void Shutdown() OVERRIDE; |
| 125 | 125 |
| 126 // BrowserContextKeyedAPI implementation. | 126 // BrowserContextKeyedAPI implementation. |
| 127 static BrowserContextKeyedAPIFactory<PushMessagingAPI>* GetFactoryInstance(); | 127 static BrowserContextKeyedAPIFactory<PushMessagingAPI>* GetFactoryInstance(); |
| 128 | 128 |
| 129 // For testing purposes. | 129 // For testing purposes. |
| 130 PushMessagingEventRouter* GetEventRouterForTest() const { | 130 PushMessagingEventRouter* GetEventRouterForTest() const { |
| 131 return event_router_.get(); | 131 return event_router_.get(); |
| 132 } | 132 } |
| 133 PushMessagingInvalidationMapper* GetMapperForTest() const { | 133 PushMessagingInvalidationMapper* GetMapperForTest() const { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 161 DISALLOW_COPY_AND_ASSIGN(PushMessagingAPI); | 161 DISALLOW_COPY_AND_ASSIGN(PushMessagingAPI); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 template <> | 164 template <> |
| 165 void BrowserContextKeyedAPIFactory< | 165 void BrowserContextKeyedAPIFactory< |
| 166 PushMessagingAPI>::DeclareFactoryDependencies(); | 166 PushMessagingAPI>::DeclareFactoryDependencies(); |
| 167 | 167 |
| 168 } // namespace extensions | 168 } // namespace extensions |
| 169 | 169 |
| 170 #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ | 170 #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| OLD | NEW |