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_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
7 | 7 |
8 #include "content/public/common/webkit_param_traits.h" | 8 #include <map> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
9 #include "content/public/renderer/render_view_observer.h" | 11 #include "content/public/renderer/render_view_observer.h" |
10 #include "ipc/ipc_channel_handle.h" | 12 #include "ipc/ipc_channel_handle.h" |
| 13 #include "third_party/npapi/bindings/npruntime.h" |
11 | 14 |
12 class JavaBridgeChannel; | 15 class JavaBridgeChannel; |
| 16 struct NPVariant_Param; |
13 | 17 |
14 // This class handles injecting Java objects into the main frame of a | 18 // This class handles injecting Java objects into the main frame of a |
15 // RenderView. The 'add' and 'remove' messages received from the browser | 19 // RenderView. The 'add' and 'remove' messages received from the browser |
16 // process modify the entries in a map of 'pending' objects. These objects are | 20 // process modify the entries in a map of 'pending' objects. These objects are |
17 // bound to the window object of the main frame when that window object is next | 21 // bound to the window object of the main frame when that window object is next |
18 // cleared. These objects remain bound until the window object is cleared | 22 // cleared. These objects remain bound until the window object is cleared |
19 // again. | 23 // again. |
20 class JavaBridgeDispatcher : public content::RenderViewObserver { | 24 class JavaBridgeDispatcher : public content::RenderViewObserver { |
21 public: | 25 public: |
22 JavaBridgeDispatcher(content::RenderView* render_view); | 26 JavaBridgeDispatcher(content::RenderView* render_view); |
(...skipping 12 matching lines...) Expand all Loading... |
35 void EnsureChannelIsSetUp(); | 39 void EnsureChannelIsSetUp(); |
36 | 40 |
37 // Objects that will be bound to the window when the window object is next | 41 // Objects that will be bound to the window when the window object is next |
38 // cleared. We hold a ref to these. | 42 // cleared. We hold a ref to these. |
39 typedef std::map<string16, NPVariant> ObjectMap; | 43 typedef std::map<string16, NPVariant> ObjectMap; |
40 ObjectMap objects_; | 44 ObjectMap objects_; |
41 scoped_refptr<JavaBridgeChannel> channel_; | 45 scoped_refptr<JavaBridgeChannel> channel_; |
42 }; | 46 }; |
43 | 47 |
44 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ | 48 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
OLD | NEW |