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