Home | History | Annotate | Download | only in device_orientation

Lines Matching refs:orientation

10 #include "content/browser/device_orientation/orientation.h"
33 // Retrieve per-axis orientation values.
36 // See here: http://dev.w3.org/geo/api/spec-source-orientation.html
42 const Orientation* AccelerometerMac::GetOrientation() {
72 scoped_refptr<Orientation> orientation(new Orientation());
74 orientation->set_beta(kRad2deg * atan2(-axis_value[1], axis_value[2]));
75 orientation->set_gamma(kRad2deg * asin(axis_value[0]));
82 if (orientation->beta() == 180.0) {
83 orientation->set_beta(-180.0); // -180 == 180 (upside-down)
85 if (orientation->gamma() == 90.0) {
87 orientation->set_gamma(just_less_than_90);
91 DCHECK_GE(orientation->beta(), -180.0);
92 DCHECK_LT(orientation->beta(), 180.0);
93 DCHECK_GE(orientation->gamma(), -90.0);
94 DCHECK_LT(orientation->gamma(), 90.0);
96 orientation->AddRef();
97 return orientation.get();