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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_
8 #include "chrome/browser/extensions/api/messaging/message_service.h"
10 namespace extensions
{
11 class NativeMessageProcessHost
;
13 // A port that manages communication with a native application.
14 class NativeMessagePort
: public MessageService::MessagePort
{
16 // Takes ownership of |native_process|.
17 explicit NativeMessagePort(NativeMessageProcessHost
* native_process
);
18 virtual ~NativeMessagePort();
19 virtual void DispatchOnMessage(const Message
& message
,
20 int target_port_id
) OVERRIDE
;
23 NativeMessageProcessHost
* native_process_
;
26 } // namespace extensions
28 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PORT_H_