| Index: content/browser/device_orientation/orientation.h
|
| diff --git a/content/browser/device_orientation/orientation.h b/content/browser/device_orientation/orientation.h
|
| index f4679b23b7730e39c1911fc0d5aef23765429747..78ad79065d90eb10d344acb85e9c6664c578e3d6 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 {
|
| -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
|
| @@ -19,34 +22,14 @@ class Orientation {
|
| can_provide_beta_(false),
|
| 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();
|
| + device_data_type_ = DeviceData::kDeviceOrientationData;
|
| }
|
|
|
| static Orientation Empty() { return Orientation(); }
|
|
|
| - 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;
|
|
|