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

Side by Side Diff: chrome/browser/device_orientation/accelerometer_mac.h

Issue 6586001: Move appcache/file_sytem/device_orientation subdirectories of chrome\browser ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 9 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file is based on the SMSLib library.
6 //
7 // SMSLib Sudden Motion Sensor Access Library
8 // Copyright (c) 2010 Suitable Systems
9 // All rights reserved.
10 //
11 // Developed by: Daniel Griscom
12 // Suitable Systems
13 // http://www.suitable.com
14 //
15 // Permission is hereby granted, free of charge, to any person obtaining a
16 // copy of this software and associated documentation files (the
17 // "Software"), to deal with the Software without restriction, including
18 // without limitation the rights to use, copy, modify, merge, publish,
19 // distribute, sublicense, and/or sell copies of the Software, and to
20 // permit persons to whom the Software is furnished to do so, subject to
21 // the following conditions:
22 //
23 // - Redistributions of source code must retain the above copyright notice,
24 // this list of conditions and the following disclaimers.
25 //
26 // - Redistributions in binary form must reproduce the above copyright
27 // notice, this list of conditions and the following disclaimers in the
28 // documentation and/or other materials provided with the distribution.
29 //
30 // - Neither the names of Suitable Systems nor the names of its
31 // contributors may be used to endorse or promote products derived from
32 // this Software without specific prior written permission.
33 //
34 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
35 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37 // IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
38 // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
39 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 // SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
41 //
42 // For more information about SMSLib, see
43 // <http://www.suitable.com/tools/smslib.html>
44 // or contact
45 // Daniel Griscom
46 // Suitable Systems
47 // 1 Centre Street, Suite 204
48 // Wakefield, MA 01880
49 // (781) 665-0053
50
51 #ifndef CHROME_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_
52 #define CHROME_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_
53 #pragma once
54
55 #include <vector>
56
57 #include <IOKit/IOKitLib.h>
58
59 #include "chrome/browser/device_orientation/data_fetcher.h"
60
61 namespace device_orientation {
62
63 // Provides an easy-to-use interface to retrieve data
64 // from the MacBook family accelerometer.
65 class AccelerometerMac : public DataFetcher {
66 public:
67 static DataFetcher* Create();
68
69 // Implement DataFetcher.
70 virtual bool GetOrientation(Orientation* orientation);
71
72 virtual ~AccelerometerMac();
73
74 private:
75 AccelerometerMac();
76 bool Init();
77
78 // Extend the sign of an integer of size bytes to a 32-bit one.
79 static int ExtendSign(int value, size_t size);
80
81 struct GenericMacbookSensor;
82 struct SensorDescriptor;
83 struct AxisData;
84
85 // Generic sensor data and list of supported sensors.
86 static const GenericMacbookSensor kGenericSensor;
87 static const SensorDescriptor kSupportedSensors[];
88
89 // Local sensor if supported, else NULL.
90 const SensorDescriptor* sensor_;
91
92 // IOKit connection to the local sensor.
93 io_connect_t io_connection_;
94
95 // Input memory used for sensor I/O.
96 std::vector<char> input_record_;
97
98 // Output memory used for sensor I/O.
99 std::vector<char> output_record_;
100 };
101
102 } // namespace device_orientation
103
104 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data_remover.h ('k') | chrome/browser/device_orientation/accelerometer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698