| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "V8DeviceOrientationEvent.h" | 27 #include "V8DeviceOrientationEvent.h" |
| 28 | 28 |
| 29 #include "bindings/v8/V8Binding.h" | 29 #include "bindings/v8/V8Binding.h" |
| 30 #include "modules/device_orientation/DeviceOrientationData.h" | 30 #include "modules/device_orientation/DeviceOrientationData.h" |
| 31 #include <v8.h> | 31 #include <v8.h> |
| 32 | 32 |
| 33 namespace WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 void V8DeviceOrientationEvent::initDeviceOrientationEventMethodCustom(const v8::
FunctionCallbackInfo<v8::Value>& args) | 35 void V8DeviceOrientationEvent::initDeviceOrientationEventMethodCustom(const v8::
FunctionCallbackInfo<v8::Value>& info) |
| 36 { | 36 { |
| 37 DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(args.Holder
()); | 37 DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(info.Holder
()); |
| 38 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]); | 38 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); |
| 39 bool bubbles = args[1]->BooleanValue(); | 39 bool bubbles = info[1]->BooleanValue(); |
| 40 bool cancelable = args[2]->BooleanValue(); | 40 bool cancelable = info[2]->BooleanValue(); |
| 41 // If alpha, beta, gamma or absolute are null or undefined, mark them as not
provided. | 41 // If alpha, beta, gamma or absolute are null or undefined, mark them as not
provided. |
| 42 // Otherwise, use the standard JavaScript conversion. | 42 // Otherwise, use the standard JavaScript conversion. |
| 43 bool alphaProvided = !isUndefinedOrNull(args[3]); | 43 bool alphaProvided = !isUndefinedOrNull(info[3]); |
| 44 double alpha = args[3]->NumberValue(); | 44 double alpha = info[3]->NumberValue(); |
| 45 bool betaProvided = !isUndefinedOrNull(args[4]); | 45 bool betaProvided = !isUndefinedOrNull(info[4]); |
| 46 double beta = args[4]->NumberValue(); | 46 double beta = info[4]->NumberValue(); |
| 47 bool gammaProvided = !isUndefinedOrNull(args[5]); | 47 bool gammaProvided = !isUndefinedOrNull(info[5]); |
| 48 double gamma = args[5]->NumberValue(); | 48 double gamma = info[5]->NumberValue(); |
| 49 bool absoluteProvided = !isUndefinedOrNull(args[6]); | 49 bool absoluteProvided = !isUndefinedOrNull(info[6]); |
| 50 bool absolute = args[6]->BooleanValue(); | 50 bool absolute = info[6]->BooleanValue(); |
| 51 RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(al
phaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided,
absolute); | 51 RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(al
phaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided,
absolute); |
| 52 imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get()
); | 52 imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get()
); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace WebCore | 55 } // namespace WebCore |
| OLD | NEW |