Chromium Code Reviews| Index: content/browser/device_orientation/orientation.h |
| diff --git a/content/browser/device_orientation/orientation.h b/content/browser/device_orientation/orientation.h |
| index 543ff0bc7f3026b1048fd45bad12dc5a05129332..b4be1aa12b3179274385441fa24fceebfe993e48 100644 |
| --- a/content/browser/device_orientation/orientation.h |
| +++ b/content/browser/device_orientation/orientation.h |
| @@ -5,8 +5,11 @@ |
| #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_H_ |
| #define CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_H_ |
| +#include "base/compiler_specific.h" |
| +#include "content/browser/device_orientation/device_data.h" |
| + |
| namespace device_orientation { |
|
bulach
2012/07/12 10:43:27
nit: add a \n here, and the following line needs t
aousterh
2012/07/12 17:13:57
Done.
|
| -class Orientation { |
| + class Orientation : public DeviceData { |
| public: |
| // alpha, beta, gamma and absolute are the rotations around the axes as |
| // specified in http://dev.w3.org/geo/api/spec-source-orientation.html |
| @@ -24,33 +27,12 @@ class Orientation { |
| can_provide_gamma_(false), |
| can_provide_absolute_(false) { |
| } |
| - Orientation(const Orientation& orientation) |
| - : alpha_(orientation.alpha()), |
| - beta_(orientation.beta()), |
| - gamma_(orientation.gamma()), |
| - absolute_(orientation.absolute()), |
| - can_provide_alpha_(orientation.can_provide_alpha()), |
| - can_provide_beta_(orientation.can_provide_beta()), |
| - can_provide_gamma_(orientation.can_provide_gamma()), |
| - can_provide_absolute_(orientation.can_provide_absolute()) { |
| - } |
| - void operator=(const Orientation& source) { |
| - alpha_ = source.alpha(); |
| - beta_ = source.beta(); |
| - gamma_ = source.gamma(); |
| - absolute_ = source.absolute(); |
| - can_provide_alpha_ = source.can_provide_alpha(); |
| - can_provide_beta_ = source.can_provide_beta(); |
| - can_provide_gamma_ = source.can_provide_gamma(); |
| - can_provide_absolute_ = source.can_provide_absolute(); |
| - } |
| static Orientation Empty() { return Orientation(); } |
|
bulach
2012/07/12 10:43:27
nit: I think we could remove this and just use Ori
aousterh
2012/07/12 17:13:57
Done.
|
| - bool is_empty() const { |
| - return !can_provide_alpha_ && !can_provide_beta_ && !can_provide_gamma_ |
| - && !can_provide_absolute_; |
| - } |
| + virtual DeviceData* Clone() const OVERRIDE; |
| + virtual bool IsEmpty() const OVERRIDE; |
| + virtual bool SignificantlyDifferentFrom(const DeviceData& other) OVERRIDE; |
| void set_alpha(double alpha) { |
| can_provide_alpha_ = true; |