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

Side by Side Diff: chromeos/accelerometer/accelerometer_reader.h

Issue 895993002: Correcly Report CanEnterMaximizeMode on devices without accelerometers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROMEOS_ACCELEROMETER_ACCELEROMETER_READER_H_ 5 #ifndef CHROMEOS_ACCELEROMETER_ACCELEROMETER_READER_H_
6 #define CHROMEOS_ACCELEROMETER_ACCELEROMETER_READER_H_ 6 #define CHROMEOS_ACCELEROMETER_ACCELEROMETER_READER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // message and notifies the |delegate_| with the new readings. 83 // message and notifies the |delegate_| with the new readings.
84 // Triggers another read from the accelerometer at the current sampling rate. 84 // Triggers another read from the accelerometer at the current sampling rate.
85 void OnDataRead(scoped_refptr<Reading> reading, bool success); 85 void OnDataRead(scoped_refptr<Reading> reading, bool success);
86 86
87 // The task runner to use for blocking tasks. 87 // The task runner to use for blocking tasks.
88 scoped_refptr<base::TaskRunner> task_runner_; 88 scoped_refptr<base::TaskRunner> task_runner_;
89 89
90 // The last seen accelerometer data. 90 // The last seen accelerometer data.
91 AccelerometerUpdate update_; 91 AccelerometerUpdate update_;
92 92
93 // True if OnDataRead has been called with success == true, and observers can
flackr 2015/02/06 20:18:20 nit: Observers can be notified is implementation d
jonross 2015/02/09 14:54:48 Done.
94 // be notified.
95 bool successful_reading_;
96
93 // The accelerometer configuration. 97 // The accelerometer configuration.
94 scoped_refptr<Configuration> configuration_; 98 scoped_refptr<Configuration> configuration_;
95 99
96 ObserverList<Observer, true> observers_; 100 ObserverList<Observer, true> observers_;
97 101
98 base::WeakPtrFactory<AccelerometerReader> weak_factory_; 102 base::WeakPtrFactory<AccelerometerReader> weak_factory_;
99 103
100 DISALLOW_COPY_AND_ASSIGN(AccelerometerReader); 104 DISALLOW_COPY_AND_ASSIGN(AccelerometerReader);
101 }; 105 };
102 106
103 } // namespace chromeos 107 } // namespace chromeos
104 108
105 #endif // CHROMEOS_ACCELEROMETER_ACCELEROMETER_READER_H_ 109 #endif // CHROMEOS_ACCELEROMETER_ACCELEROMETER_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698