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

Side by Side Diff: content/browser/device_orientation/accelerometer_mac.cc

Issue 10825245: AccelerometerMac::GetOrientation(): Fix return statement. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/device_orientation/accelerometer_mac.h" 5 #include "content/browser/device_orientation/accelerometer_mac.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/device_orientation/orientation.h" 10 #include "content/browser/device_orientation/orientation.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 static double just_less_than_90 = nextafter(90, 0); 86 static double just_less_than_90 = nextafter(90, 0);
87 orientation->set_gamma(just_less_than_90); 87 orientation->set_gamma(just_less_than_90);
88 } 88 }
89 89
90 // At this point, DCHECKing is paranoia. Never hurts. 90 // At this point, DCHECKing is paranoia. Never hurts.
91 DCHECK_GE(orientation->beta(), -180.0); 91 DCHECK_GE(orientation->beta(), -180.0);
92 DCHECK_LT(orientation->beta(), 180.0); 92 DCHECK_LT(orientation->beta(), 180.0);
93 DCHECK_GE(orientation->gamma(), -90.0); 93 DCHECK_GE(orientation->gamma(), -90.0);
94 DCHECK_LT(orientation->gamma(), 90.0); 94 DCHECK_LT(orientation->gamma(), 90.0);
95 95
96 return orientation; 96 return orientation.release();
97 } 97 }
98 98
99 bool AccelerometerMac::Init() { 99 bool AccelerometerMac::Init() {
100 sudden_motion_sensor_.reset(SuddenMotionSensor::Create()); 100 sudden_motion_sensor_.reset(SuddenMotionSensor::Create());
101 return sudden_motion_sensor_.get() != NULL; 101 return sudden_motion_sensor_.get() != NULL;
102 } 102 }
103 103
104 } // namespace device_orientation 104 } // namespace device_orientation
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698