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..dcf68c136af31269e522fc57894d47f4366caf41 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| @@ -0,0 +1,40 @@ |
| +// 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__ |
|
Munjal (Google)
2012/07/31 17:36:12
Name this file push_messaging_event_router.h to ma
dcheng
2012/07/31 19:04:11
I opted to follow the general implementation patte
|
| +#define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
| + |
| +#include <string> |
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/extensions/api/push_messaging/invalidation_handler_observer.h" |
| + |
| +class Profile; |
| + |
| +namespace extensions { |
| + |
| +class ExtensionPushMessagingEventRouter : public InvalidationHandlerObserver { |
|
Munjal (Google)
2012/07/31 17:36:12
Add comment for the class.
dcheng
2012/07/31 19:04:11
Done.
|
| + public: |
| + explicit ExtensionPushMessagingEventRouter(Profile* profile); |
| + virtual ~ExtensionPushMessagingEventRouter(); |
| + |
| + void Init(); |
| + |
| + void TriggerMessageForTest(const std::string& extension_id, |
| + int subchannel, |
| + const std::string& payload); |
|
Munjal (Google)
2012/07/31 17:36:12
Test class can become a friend class and directly
dcheng
2012/07/31 19:04:11
Done. That being said, I think the ForTest method
Munjal (Google)
2012/07/31 23:09:58
Yeah, I agree about readabiity of ForTest. But I d
|
| + |
| + private: |
| + // 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__ |