Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Side by Side Diff: third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.cpp

Issue 2767473004: Update DeviceMotionEvent IDL to match the specification. (Closed)
Patch Set: Rebased. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 init.hasAcceleration() 115 init.hasAcceleration()
116 ? DeviceMotionData::Acceleration::create(init.acceleration()) 116 ? DeviceMotionData::Acceleration::create(init.acceleration())
117 : nullptr, 117 : nullptr,
118 init.hasAccelerationIncludingGravity() 118 init.hasAccelerationIncludingGravity()
119 ? DeviceMotionData::Acceleration::create( 119 ? DeviceMotionData::Acceleration::create(
120 init.accelerationIncludingGravity()) 120 init.accelerationIncludingGravity())
121 : nullptr, 121 : nullptr,
122 init.hasRotationRate() 122 init.hasRotationRate()
123 ? DeviceMotionData::RotationRate::create(init.rotationRate()) 123 ? DeviceMotionData::RotationRate::create(init.rotationRate())
124 : nullptr, 124 : nullptr,
125 init.hasInterval() ? init.interval() : 0); 125 init.interval());
126 } 126 }
127 127
128 DeviceMotionData* DeviceMotionData::create(const device::MotionData& data) { 128 DeviceMotionData* DeviceMotionData::create(const device::MotionData& data) {
129 return DeviceMotionData::create( 129 return DeviceMotionData::create(
130 DeviceMotionData::Acceleration::create( 130 DeviceMotionData::Acceleration::create(
131 data.has_acceleration_x, data.acceleration_x, data.has_acceleration_y, 131 data.has_acceleration_x, data.acceleration_x, data.has_acceleration_y,
132 data.acceleration_y, data.has_acceleration_z, data.acceleration_z), 132 data.acceleration_y, data.has_acceleration_z, data.acceleration_z),
133 DeviceMotionData::Acceleration::create( 133 DeviceMotionData::Acceleration::create(
134 data.has_acceleration_including_gravity_x, 134 data.has_acceleration_including_gravity_x,
135 data.acceleration_including_gravity_x, 135 data.acceleration_including_gravity_x,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 m_accelerationIncludingGravity->canProvideZ()); 173 m_accelerationIncludingGravity->canProvideZ());
174 const bool hasRotationRate = 174 const bool hasRotationRate =
175 m_rotationRate && 175 m_rotationRate &&
176 (m_rotationRate->canProvideAlpha() || m_rotationRate->canProvideBeta() || 176 (m_rotationRate->canProvideAlpha() || m_rotationRate->canProvideBeta() ||
177 m_rotationRate->canProvideGamma()); 177 m_rotationRate->canProvideGamma());
178 178
179 return hasAcceleration || hasAccelerationIncludingGravity || hasRotationRate; 179 return hasAcceleration || hasAccelerationIncludingGravity || hasRotationRate;
180 } 180 }
181 181
182 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698