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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // cleared. These objects remain bound until the window object is cleared | 24 // cleared. These objects remain bound until the window object is cleared |
25 // again. | 25 // again. |
26 class JavaBridgeDispatcher : public RenderFrameObserver { | 26 class JavaBridgeDispatcher : public RenderFrameObserver { |
27 public: | 27 public: |
28 JavaBridgeDispatcher(RenderFrame* render_frame); | 28 JavaBridgeDispatcher(RenderFrame* render_frame); |
29 virtual ~JavaBridgeDispatcher(); | 29 virtual ~JavaBridgeDispatcher(); |
30 | 30 |
31 private: | 31 private: |
32 // RenderViewObserver override: | 32 // RenderViewObserver override: |
33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
34 virtual void DidClearWindowObject(int world_id) OVERRIDE; | 34 virtual void DidClearWindowObject() OVERRIDE; |
35 | 35 |
36 // Message handlers | 36 // Message handlers |
37 void OnAddNamedObject(const base::string16& name, | 37 void OnAddNamedObject(const base::string16& name, |
38 const NPVariant_Param& variant_param); | 38 const NPVariant_Param& variant_param); |
39 void OnRemoveNamedObject(const base::string16& name); | 39 void OnRemoveNamedObject(const base::string16& name); |
40 | 40 |
41 void EnsureChannelIsSetUp(); | 41 void EnsureChannelIsSetUp(); |
42 | 42 |
43 // Objects that will be bound to the window when the window object is next | 43 // Objects that will be bound to the window when the window object is next |
44 // cleared. We hold a ref to these. | 44 // cleared. We hold a ref to these. |
45 typedef std::map<base::string16, NPVariant> ObjectMap; | 45 typedef std::map<base::string16, NPVariant> ObjectMap; |
46 ObjectMap objects_; | 46 ObjectMap objects_; |
47 scoped_refptr<JavaBridgeChannel> channel_; | 47 scoped_refptr<JavaBridgeChannel> channel_; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace content | 50 } // namespace content |
51 | 51 |
52 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ | 52 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
OLD | NEW |