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

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

Issue 10823318: Moves device_orientation to content namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Attempts to fix trybots 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
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"
11 #include "third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h" 11 #include "third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h"
12 12
13 namespace device_orientation { 13 namespace content {
14 14
15 // Create a AccelerometerMac object and return NULL if no valid sensor found. 15 // Create a AccelerometerMac object and return NULL if no valid sensor found.
16 DataFetcher* AccelerometerMac::Create() { 16 DataFetcher* AccelerometerMac::Create() {
17 scoped_ptr<AccelerometerMac> accelerometer(new AccelerometerMac); 17 scoped_ptr<AccelerometerMac> accelerometer(new AccelerometerMac);
18 return accelerometer->Init() ? accelerometer.release() : NULL; 18 return accelerometer->Init() ? accelerometer.release() : NULL;
19 } 19 }
20 20
21 AccelerometerMac::~AccelerometerMac() { 21 AccelerometerMac::~AccelerometerMac() {
22 } 22 }
23 23
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 DCHECK_LT(orientation->gamma(), 90.0); 94 DCHECK_LT(orientation->gamma(), 90.0);
95 95
96 return orientation.release(); 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 content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698