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

Unified Diff: third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h

Issue 9844020: Move the Sudden Motion Sensor library into third_party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DEPS: convert line endings Created 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h
diff --git a/content/browser/device_orientation/accelerometer_mac.h b/third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h
similarity index 82%
copy from content/browser/device_orientation/accelerometer_mac.h
copy to third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h
index 853b4d5b03cde3589036438bca5430a2120b0495..ba70b398e058ccbefd4b3bd7df67d8929d758c2e 100644
--- a/content/browser/device_orientation/accelerometer_mac.h
+++ b/third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -48,32 +48,24 @@
// Wakefield, MA 01880
// (781) 665-0053
-#ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_
-#define CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_
+#ifndef SUDDEN_MOTION_SENSOR_H_
+#define SUDDEN_MOTION_SENSOR_H_
#pragma once
#include <vector>
#include <IOKit/IOKitLib.h>
-#include "base/compiler_specific.h"
-#include "content/browser/device_orientation/data_fetcher.h"
-
-namespace device_orientation {
-
// Provides an easy-to-use interface to retrieve data
// from the MacBook family accelerometer.
-class AccelerometerMac : public DataFetcher {
+class SuddenMotionSensor {
public:
- static DataFetcher* Create();
-
- // Implement DataFetcher.
- virtual bool GetOrientation(Orientation* orientation) OVERRIDE;
-
- virtual ~AccelerometerMac();
+ static SuddenMotionSensor* Create();
+ bool ReadSensorValues(float axes[3]);
+ ~SuddenMotionSensor();
private:
- AccelerometerMac();
+ SuddenMotionSensor();
bool Init();
// Extend the sign of an integer of size bytes to a 32-bit one.
@@ -100,6 +92,4 @@ class AccelerometerMac : public DataFetcher {
std::vector<char> output_record_;
};
-} // namespace device_orientation
-
-#endif // CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_
+#endif // SUDDEN_MOTION_SENSOR_H_

Powered by Google App Engine
This is Rietveld 408576698