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 <string> |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" |
| 12 #include "chrome/browser/extensions/api/push_messaging/invalidation_handler_obse
rver.h" |
| 13 |
| 14 class Profile; |
| 15 |
| 16 namespace extensions { |
| 17 |
| 18 // Observes a single InvalidationHandler and generates onMessage events. |
| 19 class PushMessagingEventRouter : public InvalidationHandlerObserver { |
| 20 public: |
| 21 explicit PushMessagingEventRouter(Profile* profile); |
| 22 virtual ~PushMessagingEventRouter(); |
| 23 |
| 24 void Init(); |
| 25 |
| 26 private: |
| 27 FRIEND_TEST_ALL_PREFIXES(PushMessagingApiTest, EventDispatch); |
| 28 |
| 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 |
| 36 DISALLOW_COPY_AND_ASSIGN(PushMessagingEventRouter); |
| 37 }; |
| 38 |
| 39 } // namespace extension |
| 40 |
| 41 #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
OLD | NEW |