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

Side by Side Diff: content/browser/device_orientation/data_fetcher_impl_android.h

Issue 15817019: Additions to the Android java-side Device Motion/Orientation fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments from Marcus Created 7 years, 6 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
« no previous file with comments | « no previous file | content/browser/device_orientation/data_fetcher_impl_android.cc » ('j') | 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 #ifndef CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ 5 #ifndef CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_
6 #define CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ 6 #define CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_
7 7
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 private: 50 private:
51 DataFetcherImplAndroid(); 51 DataFetcherImplAndroid();
52 const Orientation* GetOrientation(); 52 const Orientation* GetOrientation();
53 53
54 // Wrappers for JNI methods. 54 // Wrappers for JNI methods.
55 // TODO(timvolodine): move the DeviceData::Type enum to the service class 55 // TODO(timvolodine): move the DeviceData::Type enum to the service class
56 // once it is implemented. 56 // once it is implemented.
57 bool Start(DeviceData::Type event_type, int rate_in_milliseconds); 57 bool Start(DeviceData::Type event_type, int rate_in_milliseconds);
58 void Stop(DeviceData::Type event_type); 58 void Stop(DeviceData::Type event_type);
59 59
60 virtual int GetNumberActiveDeviceMotionSensors();
61
60 // Value returned by GetDeviceData. 62 // Value returned by GetDeviceData.
61 scoped_refptr<Orientation> current_orientation_; 63 scoped_refptr<Orientation> current_orientation_;
62 64
63 // 1-element buffer, written by GotOrientation, read by GetDeviceData. 65 // 1-element buffer, written by GotOrientation, read by GetDeviceData.
64 base::Lock next_orientation_lock_; 66 base::Lock next_orientation_lock_;
65 scoped_refptr<Orientation> next_orientation_; 67 scoped_refptr<Orientation> next_orientation_;
66 68
67 // The Java provider of orientation info. 69 // The Java provider of orientation info.
68 base::android::ScopedJavaGlobalRef<jobject> device_orientation_; 70 base::android::ScopedJavaGlobalRef<jobject> device_orientation_;
69 71
70 DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid); 72 DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid);
71 }; 73 };
72 74
73 } // namespace content 75 } // namespace content
74 76
75 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ 77 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/device_orientation/data_fetcher_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698