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

Issue 680383007: DeviceOrientation API on ChromeOS (Closed)

Created:
6 years, 1 month ago by jonross
Modified:
5 years, 10 months ago
CC:
chromium-reviews, sadrul, riju_, timvolodine, darin-cc_chromium.org, Michael van Ouwerkerk, kalyank
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DeviceOrientation API on ChromeOS Create a public SensorManager in content, so that platforms like ChromeOS can pass along sensor information. Currently only accelerometers are available. This manager will be used in the future for the DeviceMotion api as well. Create an accelerometer observer in ash to pass sensor data to the content shell. TEST=SensorManagerTest.OrientationBuffer, SensorManagerTest.NeutralOrientation, SensorManagerTest.UpsideDown, SensorManagerTest.BeforeUpsideDownBoundary, SensorManagerTest.LeftEdge, SensorManagerTest.RightEdge, SensorManagerTest.BeforeRightEdgeBoundary BUG=342908

Patch Set 1 : #

Total comments: 18

Patch Set 2 : Isolate Chrome OS changes #

Total comments: 19

Patch Set 3 : Remove implementation details from content/public/browser #

Total comments: 22

Patch Set 4 : #

Patch Set 5 : Move ash files using content into ash/content #

Total comments: 2

Patch Set 6 : Rebase and Rob's comment #

Total comments: 6

Patch Set 7 : Reduce Singleton Usage #

Total comments: 20

Patch Set 8 : #

Total comments: 4

Patch Set 9 : #

Total comments: 7

Patch Set 10 : Rebase to Updated Accelerometer #

Patch Set 11 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+532 lines, -18 lines) Patch
M ash/ash.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A ash/content/accelerometer/DEPS View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
A ash/content/accelerometer/sensor_manager_delegate_chromeos.h View 1 2 3 4 5 6 7 8 9 1 chunk +42 lines, -0 lines 0 comments Download
A ash/content/accelerometer/sensor_manager_delegate_chromeos.cc View 1 2 3 4 5 6 7 8 9 1 chunk +55 lines, -0 lines 0 comments Download
M ash/shell.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M ash/shell.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -0 lines 0 comments Download
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
A + content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc View 1 2 3 chunks +8 lines, -18 lines 0 comments Download
A content/browser/device_sensors/sensor_manager_chromeos.h View 1 2 3 4 5 6 7 1 chunk +78 lines, -0 lines 0 comments Download
A content/browser/device_sensors/sensor_manager_chromeos.cc View 1 2 3 4 5 6 7 8 1 chunk +118 lines, -0 lines 0 comments Download
A content/browser/device_sensors/sensor_manager_chromeos_unittest.cc View 1 2 3 4 5 6 1 chunk +137 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 4 chunks +6 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
A content/public/browser/sensor_manager_delegate_chromeos.h View 1 2 3 4 5 6 7 8 1 chunk +47 lines, -0 lines 0 comments Download
A content/public/browser/sensor_manager_delegate_chromeos.cc View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (9 generated)
jonross
Hi Rob and Tim, In this review I create a public sensor manager in content, ...
6 years, 1 month ago (2014-11-05 21:39:18 UTC) #4
timvolodine
Hi Jon, some initial comments below. https://codereview.chromium.org/680383007/diff/40001/content/browser/device_sensors/data_fetcher_shared_memory_default.cc File content/browser/device_sensors/data_fetcher_shared_memory_default.cc (right): https://codereview.chromium.org/680383007/diff/40001/content/browser/device_sensors/data_fetcher_shared_memory_default.cc#newcode67 content/browser/device_sensors/data_fetcher_shared_memory_default.cc:67: SensorManager::GetInstance()->StartFetchingDeviceOrientationData( this line ...
6 years, 1 month ago (2014-11-06 02:53:47 UTC) #5
jonross
https://codereview.chromium.org/680383007/diff/40001/content/browser/device_sensors/data_fetcher_shared_memory_default.cc File content/browser/device_sensors/data_fetcher_shared_memory_default.cc (right): https://codereview.chromium.org/680383007/diff/40001/content/browser/device_sensors/data_fetcher_shared_memory_default.cc#newcode67 content/browser/device_sensors/data_fetcher_shared_memory_default.cc:67: SensorManager::GetInstance()->StartFetchingDeviceOrientationData( On 2014/11/06 02:53:47, timvolodine wrote: > this line ...
6 years, 1 month ago (2014-11-06 18:18:52 UTC) #6
timvolodine
thanks Jon, some more comments: https://codereview.chromium.org/680383007/diff/60001/ash/accelerometer/sensor_manager_delegate.cc File ash/accelerometer/sensor_manager_delegate.cc (right): https://codereview.chromium.org/680383007/diff/60001/ash/accelerometer/sensor_manager_delegate.cc#newcode11 ash/accelerometer/sensor_manager_delegate.cc:11: #include "ui/gfx/geometry/vector3d_f.h" is this ...
6 years, 1 month ago (2014-11-07 03:27:39 UTC) #7
flackr
https://codereview.chromium.org/680383007/diff/60001/ash/accelerometer/sensor_manager_delegate.cc File ash/accelerometer/sensor_manager_delegate.cc (right): https://codereview.chromium.org/680383007/diff/60001/ash/accelerometer/sensor_manager_delegate.cc#newcode30 ash/accelerometer/sensor_manager_delegate.cc:30: if (!update.has(source)) nit, I think this would be a ...
6 years, 1 month ago (2014-11-07 19:30:47 UTC) #8
jonross
https://codereview.chromium.org/680383007/diff/60001/ash/accelerometer/sensor_manager_delegate.cc File ash/accelerometer/sensor_manager_delegate.cc (right): https://codereview.chromium.org/680383007/diff/60001/ash/accelerometer/sensor_manager_delegate.cc#newcode11 ash/accelerometer/sensor_manager_delegate.cc:11: #include "ui/gfx/geometry/vector3d_f.h" On 2014/11/07 03:27:39, timvolodine wrote: > is ...
6 years, 1 month ago (2014-11-07 19:59:37 UTC) #9
jonross
I have removed the implementation details from content/public/browser/ content/public/browser/device_sensor_delegate.h is now used solely as an ...
6 years, 1 month ago (2014-11-10 22:39:09 UTC) #10
flackr
https://codereview.chromium.org/680383007/diff/80001/ash/accelerometer/sensor_manager_delegate_chromeos.cc File ash/accelerometer/sensor_manager_delegate_chromeos.cc (right): https://codereview.chromium.org/680383007/diff/80001/ash/accelerometer/sensor_manager_delegate_chromeos.cc#newcode21 ash/accelerometer/sensor_manager_delegate_chromeos.cc:21: if (observing_accelerometer_) Call StopFetchingDeviceOrientationData? https://codereview.chromium.org/680383007/diff/80001/ash/accelerometer/sensor_manager_delegate_chromeos.cc#newcode40 ash/accelerometer/sensor_manager_delegate_chromeos.cc:40: double z = ...
6 years, 1 month ago (2014-11-13 00:07:34 UTC) #11
jonross
https://codereview.chromium.org/680383007/diff/80001/ash/accelerometer/sensor_manager_delegate_chromeos.cc File ash/accelerometer/sensor_manager_delegate_chromeos.cc (right): https://codereview.chromium.org/680383007/diff/80001/ash/accelerometer/sensor_manager_delegate_chromeos.cc#newcode21 ash/accelerometer/sensor_manager_delegate_chromeos.cc:21: if (observing_accelerometer_) On 2014/11/13 00:07:34, flackr wrote: > Call ...
6 years, 1 month ago (2014-11-13 01:34:05 UTC) #12
flackr
LGTM https://codereview.chromium.org/680383007/diff/120001/content/public/browser/sensor_manager_delegate.h File content/public/browser/sensor_manager_delegate.h (right): https://codereview.chromium.org/680383007/diff/120001/content/public/browser/sensor_manager_delegate.h#newcode17 content/public/browser/sensor_manager_delegate.h:17: typedef base::Callback<void(double, double, double)> OrientationDataXYZCallback; nit: double x, ...
6 years, 1 month ago (2014-11-13 21:09:22 UTC) #13
jonross
https://codereview.chromium.org/680383007/diff/120001/content/public/browser/sensor_manager_delegate.h File content/public/browser/sensor_manager_delegate.h (right): https://codereview.chromium.org/680383007/diff/120001/content/public/browser/sensor_manager_delegate.h#newcode17 content/public/browser/sensor_manager_delegate.h:17: typedef base::Callback<void(double, double, double)> OrientationDataXYZCallback; On 2014/11/13 21:09:22, flackr ...
6 years, 1 month ago (2014-11-17 21:54:10 UTC) #14
jonross
Hi Tim, Would you be able to take another look at this review for the ...
6 years, 1 month ago (2014-11-21 16:14:28 UTC) #15
timvolodine
looks much better thanks! below some more comments let me know what you think. https://codereview.chromium.org/680383007/diff/140001/content/public/browser/sensor_manager_delegate.h ...
6 years ago (2014-11-24 14:51:05 UTC) #16
jonross
Updated with clean up of SensorManagerDelegateChromeOS. This class is no longer a singleton. I did ...
6 years ago (2014-11-24 22:53:01 UTC) #19
timvolodine
ok thanks for the explanation, I didn't realize you had a TODO and a crbug ...
6 years ago (2014-11-26 19:32:19 UTC) #20
jonross
I've provided clarifications to some of your questions. I will be OOO until Monday, December ...
6 years ago (2014-11-26 23:17:56 UTC) #21
timvolodine
https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h File content/browser/device_sensors/sensor_manager_chromeos.h (right): https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h#newcode20 content/browser/device_sensors/sensor_manager_chromeos.h:20: class SensorManagerChromeOSTest; no need for this? https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h#newcode27 content/browser/device_sensors/sensor_manager_chromeos.h:27: : ...
6 years ago (2014-11-28 17:46:06 UTC) #22
jonross
https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h File content/browser/device_sensors/sensor_manager_chromeos.h (right): https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h#newcode20 content/browser/device_sensors/sensor_manager_chromeos.h:20: class SensorManagerChromeOSTest; On 2014/11/28 17:46:06, timvolodine wrote: > no ...
6 years ago (2014-12-02 16:13:36 UTC) #23
timvolodine
thanks Jon, lgtm https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h File content/browser/device_sensors/sensor_manager_chromeos.h (right): https://codereview.chromium.org/680383007/diff/200001/content/browser/device_sensors/sensor_manager_chromeos.h#newcode20 content/browser/device_sensors/sensor_manager_chromeos.h:20: class SensorManagerChromeOSTest; On 2014/12/02 16:13:36, jonross ...
6 years ago (2014-12-03 13:19:56 UTC) #24
jonross
https://codereview.chromium.org/680383007/diff/220001/content/browser/device_sensors/sensor_manager_chromeos.cc File content/browser/device_sensors/sensor_manager_chromeos.cc (right): https://codereview.chromium.org/680383007/diff/220001/content/browser/device_sensors/sensor_manager_chromeos.cc#newcode61 content/browser/device_sensors/sensor_manager_chromeos.cc:61: // Null message to signify that sensors are no ...
6 years ago (2014-12-03 14:43:58 UTC) #25
jonross
oshima@chromium.org: Please review changes in ash/ ash/content/accelerometer/ In this review I am implementing the DeviceOrientation ...
6 years ago (2014-12-03 14:48:44 UTC) #27
jonross
avi@chromium.org: Please review changes in content/browser/BUILD.gn content/public/browser/ Thanks, Jon
6 years ago (2014-12-03 14:54:19 UTC) #29
oshima
ash lgtm https://codereview.chromium.org/680383007/diff/240001/ash/content/accelerometer/DEPS File ash/content/accelerometer/DEPS (right): https://codereview.chromium.org/680383007/diff/240001/ash/content/accelerometer/DEPS#newcode2 ash/content/accelerometer/DEPS:2: "+content/public/browser/sensor_manager_delegate_chromeos.h", or just "+content/public/browser" I'm fine with ...
6 years ago (2014-12-03 21:03:10 UTC) #30
jonross
Hi Avi, Would you be able to provide the owners review to: content/browser/BUILD.gn content/public/browser/* Thanks, ...
6 years ago (2014-12-08 15:23:38 UTC) #31
jonross
Hi Charlie, Could you provide an owner review to: content/browser/BUILD.gn content/public/browser/* Thanks, Jon
6 years ago (2014-12-09 23:58:17 UTC) #33
Charlie Reis
@jam: Can you weigh in on the new ChromeOS-specific delegate (and proposed observer) in content/public/browser? ...
6 years ago (2014-12-10 01:02:41 UTC) #35
jonross
https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h File content/public/browser/sensor_manager_delegate_chromeos.h (right): https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h#newcode22 content/public/browser/sensor_manager_delegate_chromeos.h:22: // content/public/browser expose an observer for ChromeOS. (crbug.com/431865) On ...
6 years ago (2014-12-10 13:58:27 UTC) #36
jam
https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h File content/public/browser/sensor_manager_delegate_chromeos.h (right): https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h#newcode22 content/public/browser/sensor_manager_delegate_chromeos.h:22: // content/public/browser expose an observer for ChromeOS. (crbug.com/431865) On ...
6 years ago (2014-12-10 21:57:05 UTC) #37
jonross
https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h File content/public/browser/sensor_manager_delegate_chromeos.h (right): https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h#newcode22 content/public/browser/sensor_manager_delegate_chromeos.h:22: // content/public/browser expose an observer for ChromeOS. (crbug.com/431865) On ...
6 years ago (2014-12-10 23:06:22 UTC) #38
jam
On 2014/12/10 23:06:22, jonross wrote: > https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h > File content/public/browser/sensor_manager_delegate_chromeos.h (right): > > https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h#newcode22 > ...
6 years ago (2014-12-10 23:08:38 UTC) #39
jonross
On 2014/12/10 23:08:38, jam wrote: > On 2014/12/10 23:06:22, jonross wrote: > > > https://codereview.chromium.org/680383007/diff/240001/content/public/browser/sensor_manager_delegate_chromeos.h ...
6 years ago (2014-12-10 23:55:40 UTC) #40
jam
6 years ago (2014-12-15 19:12:34 UTC) #41
On 2014/12/10 23:55:40, jonross wrote:
> On 2014/12/10 23:08:38, jam wrote:
> > On 2014/12/10 23:06:22, jonross wrote:
> > >
> >
>
https://codereview.chromium.org/680383007/diff/240001/content/public/browser/...
> > > File content/public/browser/sensor_manager_delegate_chromeos.h (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/680383007/diff/240001/content/public/browser/...
> > > content/public/browser/sensor_manager_delegate_chromeos.h:22: //
> > > content/public/browser expose an observer for ChromeOS. (crbug.com/431865)
> > > On 2014/12/10 21:57:05, jam wrote:
> > > > On 2014/12/10 13:58:27, jonross wrote:
> > > > > On 2014/12/10 01:02:41, Charlie Reis wrote:
> > > > > > Avoiding this delegate in the public interface would be nice if
> > possible. 
> > > > Is
> > > > > > there a lot of work required for this?
> > > > > 
> > > > > It's a decent amount of work. I had been planning to address it in
m-42
> as
> > > > that
> > > > > move would directly conflict with some other in progress work.
> > > > 
> > > > can you explain some more on what work is needed?
> > > > 
> > > > why can't this be directly implemented inside content?
> > > 
> > > My end goal is to have the ChromeOS accelerometer read within content/ and
> for
> > > other libraries, such as ash/, that need the information to listen for
> > changes.
> > > 
> > > Work that needs to be done:
> > > chromeos/accelerometer/accelerometer_reader.h needs to be moved into
> > > content/browser/device_sensors/
> > > 
> > > ash/accelerometer/accelerometer_controller.h needs to be replaced. I was
> > > planning on having
content/browser/device_sensors/sensor_manager_chromeos.h
> > > replace the portion responsible for initializing AccelerometerReader. For
> the
> > > portion that notifies observers, I was going to move that to a new class
in
> > > content/public/browser/, as ash/ still needs to listen for accelerometer
> > events/
> > 
> > i'm curious, why not have that in src/chromeos? it seems like system-level
> code,
> > i.e. what we would call windows/mac/linux OS code for, should be in
> src/chromeos
> > 
> > > 
> > > Currently the other ash code that uses the accelerometer is undergoing
some
> > > significant changes. I had planned to perform the accelerometer move after
> > both
> > > changes had landed in order to have it be one change, rather than having
to
> > > increase the complexity of either review.
> > > 
> > > The accelerometer code is also currently used in athena/ and I had yet to
> > review
> > > what changes are needed there, or if it can currently depend on content/
> 
> ash/accelerometer/accelerometer_controller.h was created to abstract the OS
> accelerometer form ash/ which is why it isn't in src/chromeos.
> 
> ui/accelerometer/accelerometer_types.h was created to provide type definitions
> for accelerometer messages, without tieing them to the OS.
> 
> chromeos/accelerometer/accelerometer_reader.h was created in the location for
> system-level code.
> 
> However this abstraction has led to chromeos/ depending on ui/ which we have
> been asked to remove. (crbug.com/431865)
> 
> content/browser/device_sensors/ could certainly just call into chromeos/.
> However AccelerometerReader is not setup to support multiple threads reading
it,
> and its current owner is in ash/

seems that should be fixed, instead of adding this layer

Powered by Google App Engine
This is Rietveld 408576698