Chromium Code Reviews| Index: chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf648d59efba298a31dc3de9bdce0f644f1f2938 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| +#define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| + |
| +#include <string> |
| +#include "base/basictypes.h" |
| +#include "base/gtest_prod_util.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/extensions/api/push_messaging/invalidation_handler_observer.h" |
| + |
| +class Profile; |
| + |
| +namespace extensions { |
| + |
| +// Observes a single InvalidationHandler and generates onMessage events. |
| +class ExtensionPushMessagingEventRouter : public InvalidationHandlerObserver { |
|
Mihai Parparita -not on Chrome
2012/08/01 20:05:50
Given that this class is in the "extensions" names
dcheng
2012/08/01 21:15:33
Done.
|
| + public: |
| + explicit ExtensionPushMessagingEventRouter(Profile* profile); |
| + virtual ~ExtensionPushMessagingEventRouter(); |
| + |
| + void Init(); |
| + |
| + private: |
| + FRIEND_TEST_ALL_PREFIXES(ExtensionPushMessagingApiTest, EventDispatch); |
| + |
| + // InvalidationHandlerObserver implementation. |
| + virtual void OnMessage(const std::string& extension_id, |
| + int subchannel, |
| + const std::string& payload) OVERRIDE; |
| + |
| + Profile* profile_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExtensionPushMessagingEventRouter); |
| +}; |
| + |
| +} // namespace extension |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |