| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/api/messaging/message_service.h" | 8 #include "chrome/browser/extensions/api/messaging/message_service.h" |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| 11 class NativeMessageProcessHost; | 11 class NativeMessageProcessHost; |
| 12 | 12 |
| 13 // A port that manages communication with a native application. | 13 // A port that manages communication with a native application. |
| 14 class NativeMessagePort : public MessageService::MessagePort { | 14 class NativeMessagePort : public MessageService::MessagePort { |
| 15 public: | 15 public: |
| 16 // Takes ownership of |native_process|. | 16 // Takes ownership of |native_process|. |
| 17 explicit NativeMessagePort(NativeMessageProcessHost* native_process); | 17 explicit NativeMessagePort(NativeMessageProcessHost* native_process); |
| 18 virtual ~NativeMessagePort(); | 18 virtual ~NativeMessagePort(); |
| 19 virtual void DispatchOnMessage(const std::string& message, | 19 virtual void DispatchOnMessage(scoped_ptr<base::ListValue> message, |
| 20 int target_port_id) OVERRIDE; | 20 int target_port_id) OVERRIDE; |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 NativeMessageProcessHost* native_process_; | 23 NativeMessageProcessHost* native_process_; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 } // namespace extensions | 26 } // namespace extensions |
| 27 | 27 |
| 28 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_ | 28 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_ |
| OLD | NEW |