| OLD | NEW |
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // 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 are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 double gamma = DartUtilities::dartToDouble(args , 6, exception); | 69 double gamma = DartUtilities::dartToDouble(args , 6, exception); |
| 70 if (exception) | 70 if (exception) |
| 71 goto fail; | 71 goto fail; |
| 72 bool gammaProvided = true; | 72 bool gammaProvided = true; |
| 73 | 73 |
| 74 bool absolute = DartUtilities::dartToBool(Dart_GetNativeArgument(args ,
7), exception); | 74 bool absolute = DartUtilities::dartToBool(Dart_GetNativeArgument(args ,
7), exception); |
| 75 if (exception) | 75 if (exception) |
| 76 goto fail; | 76 goto fail; |
| 77 bool absoluteProvided = true; | 77 bool absoluteProvided = true; |
| 78 | 78 |
| 79 RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::creat
e(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvid
ed, absolute); | 79 DeviceOrientationData* orientation = DeviceOrientationData::create(alpha
Provided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, abs
olute); |
| 80 receiver->initDeviceOrientationEvent(type, bubbles, cancelable, orientat
ion.get()); | 80 receiver->initDeviceOrientationEvent(type, bubbles, cancelable, orientat
ion); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 fail: | 84 fail: |
| 85 Dart_ThrowException(exception); | 85 Dart_ThrowException(exception); |
| 86 ASSERT_NOT_REACHED(); | 86 ASSERT_NOT_REACHED(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void absoluteGetter(Dart_NativeArguments args) | 89 void absoluteGetter(Dart_NativeArguments args) |
| 90 { | 90 { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 114 { | 114 { |
| 115 DeviceOrientationEvent* receiver = DartDOMWrapper::receiver<DeviceOrientatio
nEvent>(args); | 115 DeviceOrientationEvent* receiver = DartDOMWrapper::receiver<DeviceOrientatio
nEvent>(args); |
| 116 if (!receiver->orientation()->canProvideGamma()) | 116 if (!receiver->orientation()->canProvideGamma()) |
| 117 return; | 117 return; |
| 118 Dart_SetReturnValue(args, DartUtilities::doubleToDart(receiver->orientation(
)->gamma())); | 118 Dart_SetReturnValue(args, DartUtilities::doubleToDart(receiver->orientation(
)->gamma())); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } | 121 } |
| 122 | 122 |
| 123 } | 123 } |
| OLD | NEW |