OLD | NEW |
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 CircularRegion_h | 5 #ifndef CircularRegion_h |
6 #define CircularRegion_h | 6 #define CircularRegion_h |
7 | 7 |
8 #include "modules/geofencing/GeofencingRegion.h" | 8 #include "modules/geofencing/GeofencingRegion.h" |
| 9 #include "wtf/text/WTFString.h" |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 class Dictionary; | 13 class Dictionary; |
| 14 class WebCircularRegion; |
13 | 15 |
14 struct CircularRegionInit { | 16 struct CircularRegionInit { |
15 CircularRegionInit() : latitude(0), longitude(0), radius(0) { } | 17 CircularRegionInit() : latitude(0), longitude(0), radius(0) { } |
16 explicit CircularRegionInit(const Dictionary& init); | 18 explicit CircularRegionInit(const Dictionary& init); |
17 | 19 |
18 String id; | 20 String id; |
19 double latitude; | 21 double latitude; |
20 double longitude; | 22 double longitude; |
21 double radius; | 23 double radius; |
22 }; | 24 }; |
23 | 25 |
24 class CircularRegion FINAL : public GeofencingRegion { | 26 class CircularRegion FINAL : public GeofencingRegion { |
25 WTF_MAKE_NONCOPYABLE(CircularRegion); | 27 WTF_MAKE_NONCOPYABLE(CircularRegion); |
26 public: | 28 public: |
27 static CircularRegion* create(const Dictionary& init); | 29 static CircularRegion* create(const Dictionary& init); |
28 virtual ~CircularRegion() { } | 30 virtual ~CircularRegion() { } |
29 | 31 |
30 double latitude() const { return m_latitude; } | 32 double latitude() const; |
31 double longitude() const { return m_longitude; } | 33 double longitude() const; |
32 double radius() const { return m_radius; } | 34 double radius() const; |
33 | 35 |
34 virtual void trace(Visitor* visitor) OVERRIDE { GeofencingRegion::trace(visi
tor); } | 36 virtual void trace(Visitor* visitor) OVERRIDE { GeofencingRegion::trace(visi
tor); } |
35 | 37 |
36 private: | 38 private: |
37 explicit CircularRegion(const CircularRegionInit&); | 39 friend class GeofencingRegion; |
38 | 40 |
39 double m_latitude; | 41 explicit CircularRegion(const WebCircularRegion&); |
40 double m_longitude; | |
41 double m_radius; | |
42 }; | 42 }; |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif | 46 #endif |
OLD | NEW |