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_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "content/public/browser/render_view_host_observer.h" | 10 #include "content/public/browser/render_view_host_observer.h" |
11 | 11 |
12 class NPChannelBase; | |
13 class RouteIDGenerator; | 12 class RouteIDGenerator; |
14 struct NPObject; | 13 struct NPObject; |
15 struct NPVariant_Param; | |
16 | 14 |
17 namespace content { | 15 namespace content { |
| 16 class NPChannelBase; |
18 class RenderViewHost; | 17 class RenderViewHost; |
| 18 struct NPVariant_Param; |
19 } | 19 } |
20 | 20 |
21 // This class handles injecting Java objects into a single RenderView. The Java | 21 // This class handles injecting Java objects into a single RenderView. The Java |
22 // object itself lives in the browser process on a background thread, while a | 22 // object itself lives in the browser process on a background thread, while a |
23 // proxy object is created in the renderer. An instance of this class exists | 23 // proxy object is created in the renderer. An instance of this class exists |
24 // for each RenderViewHost. | 24 // for each RenderViewHost. |
25 class JavaBridgeDispatcherHost | 25 class JavaBridgeDispatcherHost |
26 : public base::RefCountedThreadSafe<JavaBridgeDispatcherHost>, | 26 : public base::RefCountedThreadSafe<JavaBridgeDispatcherHost>, |
27 public content::RenderViewHostObserver { | 27 public content::RenderViewHostObserver { |
28 public: | 28 public: |
(...skipping 22 matching lines...) Expand all Loading... |
51 friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>; | 51 friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>; |
52 virtual ~JavaBridgeDispatcherHost(); | 52 virtual ~JavaBridgeDispatcherHost(); |
53 | 53 |
54 // RenderViewHostObserver override: | 54 // RenderViewHostObserver override: |
55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
56 | 56 |
57 // Message handlers | 57 // Message handlers |
58 void OnGetChannelHandle(IPC::Message* reply_msg); | 58 void OnGetChannelHandle(IPC::Message* reply_msg); |
59 | 59 |
60 void GetChannelHandle(IPC::Message* reply_msg); | 60 void GetChannelHandle(IPC::Message* reply_msg); |
61 void CreateNPVariantParam(NPObject* object, NPVariant_Param* param); | 61 void CreateNPVariantParam(NPObject* object, content::NPVariant_Param* param); |
62 void CreateObjectStub(NPObject* object, int route_id); | 62 void CreateObjectStub(NPObject* object, int route_id); |
63 | 63 |
64 scoped_refptr<NPChannelBase> channel_; | 64 scoped_refptr<content::NPChannelBase> channel_; |
65 bool is_renderer_initialized_; | 65 bool is_renderer_initialized_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost); | 67 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost); |
68 }; | 68 }; |
69 | 69 |
70 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 70 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
OLD | NEW |