Index: third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp |
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp |
index a268c5975f09efa80f887228529577a800539b54..7f0b9dc97d999349750e822f6abd19f906d01e84 100644 |
--- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp |
+++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp |
@@ -24,6 +24,8 @@ |
*/ |
#include "modules/device_orientation/DeviceOrientationData.h" |
+ |
+#include "modules/device_orientation/DeviceOrientationEventInit.h" |
#include "public/platform/modules/device_orientation/WebDeviceOrientationData.h" |
namespace blink { |
@@ -41,6 +43,20 @@ DeviceOrientationData* DeviceOrientationData::create( |
} |
DeviceOrientationData* DeviceOrientationData::create( |
+ const DeviceOrientationEventInit& init) { |
+ Nullable<double> alpha; |
+ Nullable<double> beta; |
+ Nullable<double> gamma; |
+ if (init.hasAlpha()) |
+ alpha = init.alpha(); |
+ if (init.hasBeta()) |
+ beta = init.beta(); |
+ if (init.hasGamma()) |
+ gamma = init.gamma(); |
+ return DeviceOrientationData::create(alpha, beta, gamma, init.absolute()); |
+} |
+ |
+DeviceOrientationData* DeviceOrientationData::create( |
const WebDeviceOrientationData& data) { |
Nullable<double> alpha; |
Nullable<double> beta; |