| 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 CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ | 5 #ifndef CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ |
| 6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ | 6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ |
| 7 | 7 |
| 8 #include "content/common/np_channel_base.h" | 8 #include "content/common/np_channel_base.h" |
| 9 #include "ipc/ipc_channel_handle.h" | 9 #include "ipc/ipc_channel_handle.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 class JavaBridgeChannel : public NPChannelBase { | 13 class JavaBridgeChannel : public content::NPChannelBase { |
| 14 public: | 14 public: |
| 15 static JavaBridgeChannel* GetJavaBridgeChannel( | 15 static JavaBridgeChannel* GetJavaBridgeChannel( |
| 16 const IPC::ChannelHandle& channel_handle, | 16 const IPC::ChannelHandle& channel_handle, |
| 17 base::MessageLoopProxy* ipc_message_loop); | 17 base::MessageLoopProxy* ipc_message_loop); |
| 18 | 18 |
| 19 // NPChannelBase implementation: | 19 // NPChannelBase implementation: |
| 20 virtual int GenerateRouteID() OVERRIDE; | 20 virtual int GenerateRouteID() OVERRIDE; |
| 21 | 21 |
| 22 // NPChannelBase override: | 22 // NPChannelBase override: |
| 23 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 23 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 JavaBridgeChannel(); | 26 JavaBridgeChannel(); |
| 27 // This class is ref-counted. | 27 // This class is ref-counted. |
| 28 virtual ~JavaBridgeChannel(); | 28 virtual ~JavaBridgeChannel(); |
| 29 | 29 |
| 30 static NPChannelBase* ClassFactory() { return new JavaBridgeChannel(); } | 30 static NPChannelBase* ClassFactory() { return new JavaBridgeChannel(); } |
| 31 | 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannel); | 32 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannel); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace content | 35 } // namespace content |
| 36 | 36 |
| 37 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ | 37 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ |
| OLD | NEW |