OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/extensions/api/push_messaging/invalidation_handler_obse
rver.h" |
| 10 |
| 11 class Profile; |
| 12 |
| 13 namespace extensions { |
| 14 |
| 15 class InvalidationHandler; |
| 16 |
| 17 class ExtensionPushMessagingEventRouter : public InvalidationHandlerObserver { |
| 18 public: |
| 19 explicit ExtensionPushMessagingEventRouter(Profile* profile); |
| 20 virtual ~ExtensionPushMessagingEventRouter(); |
| 21 |
| 22 void Init(); |
| 23 |
| 24 void TriggerMessageForTest(const std::string& extension_id, |
| 25 int subchannel, |
| 26 const std::string& payload); |
| 27 |
| 28 private: |
| 29 // InvalidationHandlerObserver implementation. |
| 30 virtual void OnMessage(const std::string& extension_id, |
| 31 int subchannel, |
| 32 const std::string& payload) OVERRIDE; |
| 33 |
| 34 Profile* profile_; |
| 35 scoped_ptr<InvalidationHandler> handler_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(ExtensionPushMessagingEventRouter); |
| 38 }; |
| 39 |
| 40 } // namespace extension |
| 41 |
| 42 #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
OLD | NEW |