OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/renderer/extensions/renderer_extension_bindings.h" | 5 #include "chrome/renderer/extensions/renderer_extension_bindings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 elem->GetAsBoolean(&val); | 262 elem->GetAsBoolean(&val); |
263 v8_values.push_back(v8::Boolean::New(val)); | 263 v8_values.push_back(v8::Boolean::New(val)); |
264 break; | 264 break; |
265 } | 265 } |
266 case Value::TYPE_INTEGER: { | 266 case Value::TYPE_INTEGER: { |
267 int val; | 267 int val; |
268 elem->GetAsInteger(&val); | 268 elem->GetAsInteger(&val); |
269 v8_values.push_back(v8::Integer::New(val)); | 269 v8_values.push_back(v8::Integer::New(val)); |
270 break; | 270 break; |
271 } | 271 } |
272 case Value::TYPE_REAL: { | 272 case Value::TYPE_DOUBLE: { |
273 double val; | 273 double val; |
274 elem->GetAsReal(&val); | 274 elem->GetAsDouble(&val); |
275 v8_values.push_back(v8::Number::New(val)); | 275 v8_values.push_back(v8::Number::New(val)); |
276 break; | 276 break; |
277 } | 277 } |
278 case Value::TYPE_STRING: { | 278 case Value::TYPE_STRING: { |
279 std::string val; | 279 std::string val; |
280 elem->GetAsString(&val); | 280 elem->GetAsString(&val); |
281 v8_values.push_back(v8::String::New(val.c_str())); | 281 v8_values.push_back(v8::String::New(val.c_str())); |
282 break; | 282 break; |
283 } | 283 } |
284 default: | 284 default: |
(...skipping 22 matching lines...) Expand all Loading... |
307 const GURL& event_url) { | 307 const GURL& event_url) { |
308 v8::HandleScope handle_scope; | 308 v8::HandleScope handle_scope; |
309 std::vector< v8::Handle<v8::Value> > argv = ListValueToV8(args); | 309 std::vector< v8::Handle<v8::Value> > argv = ListValueToV8(args); |
310 EventBindings::CallFunction(extension_id, | 310 EventBindings::CallFunction(extension_id, |
311 function_name, | 311 function_name, |
312 argv.size(), | 312 argv.size(), |
313 &argv[0], | 313 &argv[0], |
314 renderview, | 314 renderview, |
315 event_url); | 315 event_url); |
316 } | 316 } |
OLD | NEW |