Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Side by Side Diff: content/renderer/java/gin_java_bridge_dispatcher.h

Issue 345753003: [Android] Java Bridge with Gin: implement Java Bridge dispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_GIN_JAVA_BRIDGE_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_
6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ 6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 virtual ~GinJavaBridgeDispatcher(); 43 virtual ~GinJavaBridgeDispatcher();
44 44
45 // RenderFrameObserver override: 45 // RenderFrameObserver override:
46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
47 virtual void DidClearWindowObject() OVERRIDE; 47 virtual void DidClearWindowObject() OVERRIDE;
48 48
49 void GetJavaMethods(ObjectID object_id, std::set<std::string>* methods); 49 void GetJavaMethods(ObjectID object_id, std::set<std::string>* methods);
50 bool HasJavaMethod(ObjectID object_id, const std::string& method_name); 50 bool HasJavaMethod(ObjectID object_id, const std::string& method_name);
51 scoped_ptr<base::Value> InvokeJavaMethod(ObjectID object_id, 51 scoped_ptr<base::Value> InvokeJavaMethod(ObjectID object_id,
52 const std::string& method_name, 52 const std::string& method_name,
53 const base::ListValue& arguments); 53 const base::ListValue& arguments,
54 std::string* error_message);
54 GinJavaBridgeObject* GetObject(ObjectID object_id); 55 GinJavaBridgeObject* GetObject(ObjectID object_id);
55 void OnGinJavaBridgeObjectDeleted(ObjectID object_id); 56 void OnGinJavaBridgeObjectDeleted(ObjectID object_id);
56 57
57 private: 58 private:
58 void OnAddNamedObject(const std::string& name, 59 void OnAddNamedObject(const std::string& name,
59 ObjectID object_id); 60 ObjectID object_id);
60 void OnRemoveNamedObject(const std::string& name); 61 void OnRemoveNamedObject(const std::string& name);
61 void OnSetAllowObjectContentsInspection(bool allow); 62 void OnSetAllowObjectContentsInspection(bool allow);
62 63
63 typedef std::map<std::string, ObjectID> NamedObjectMap; 64 typedef std::map<std::string, ObjectID> NamedObjectMap;
64 NamedObjectMap named_objects_; 65 NamedObjectMap named_objects_;
65 ObjectMap objects_; 66 ObjectMap objects_;
66 bool inside_did_clear_window_object_; 67 bool inside_did_clear_window_object_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcher); 69 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcher);
69 }; 70 };
70 71
71 } // namespace content 72 } // namespace content
72 73
73 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ 74 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698