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