OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This implements the JavaScript class entrypoint for the plugin instance. | 5 // This implements the JavaScript class entrypoint for the plugin instance. |
6 // The Javascript API is defined as follows. | 6 // The Javascript API is defined as follows. |
7 // | 7 // |
8 // interface ChromotingScriptableObject { | 8 // interface ChromotingScriptableObject { |
9 // | 9 // |
10 // // Chromoting session API version (for this plugin). | 10 // // Chromoting session API version (for this plugin). |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 // Sends an IQ stanza, serialized as an xml string, into Javascript for | 176 // Sends an IQ stanza, serialized as an xml string, into Javascript for |
177 // handling. | 177 // handling. |
178 void SendIq(const std::string& request_xml); | 178 void SendIq(const std::string& request_xml); |
179 | 179 |
180 private: | 180 private: |
181 typedef std::map<std::string, int> PropertyNameMap; | 181 typedef std::map<std::string, int> PropertyNameMap; |
182 typedef pp::Var (ChromotingScriptableObject::*MethodHandler)( | 182 typedef pp::Var (ChromotingScriptableObject::*MethodHandler)( |
183 const std::vector<pp::Var>& args, pp::Var* exception); | 183 const std::vector<pp::Var>& args, pp::Var* exception); |
184 struct PropertyDescriptor { | 184 struct PropertyDescriptor { |
185 explicit PropertyDescriptor(const std::string& n, pp::Var a) | 185 PropertyDescriptor(const std::string& n, pp::Var a) |
186 : type(NONE), name(n), attribute(a), method(NULL) { | 186 : type(NONE), name(n), attribute(a), method(NULL) { |
187 } | 187 } |
188 | 188 |
189 explicit PropertyDescriptor(const std::string& n, MethodHandler m) | 189 PropertyDescriptor(const std::string& n, MethodHandler m) |
190 : type(NONE), name(n), method(m) { | 190 : type(NONE), name(n), method(m) { |
191 } | 191 } |
192 | 192 |
193 enum Type { | 193 enum Type { |
194 NONE, | 194 NONE, |
195 ATTRIBUTE, | 195 ATTRIBUTE, |
196 METHOD, | 196 METHOD, |
197 } type; | 197 } type; |
198 | 198 |
199 std::string name; | 199 std::string name; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 PropertyNameMap property_names_; | 233 PropertyNameMap property_names_; |
234 std::vector<PropertyDescriptor> properties_; | 234 std::vector<PropertyDescriptor> properties_; |
235 scoped_refptr<PepperXmppProxy> xmpp_proxy_; | 235 scoped_refptr<PepperXmppProxy> xmpp_proxy_; |
236 | 236 |
237 ChromotingInstance* instance_; | 237 ChromotingInstance* instance_; |
238 }; | 238 }; |
239 | 239 |
240 } // namespace remoting | 240 } // namespace remoting |
241 | 241 |
242 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ | 242 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ |
OLD | NEW |