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 3 // found in the LICENSE file. 4 5 #ifndef CircularGeofencingRegion_h 6 #define CircularGeofencingRegion_h 7 8 #include "modules/geofencing/GeofencingRegion.h" 9 #include "public/platform/WebCircularGeofencingRegion.h" 10 11 namespace blink { 12 13 class Dictionary; 14 15 class CircularGeofencingRegion FINAL : public GeofencingRegion { 16 DEFINE_WRAPPERTYPEINFO(); 17 WTF_MAKE_NONCOPYABLE(CircularGeofencingRegion); 18 public: 19 static CircularGeofencingRegion* create(const Dictionary& init); 20 static CircularGeofencingRegion* create(const WebString& id, const WebCircularGeofencingRegion&); ~CircularGeofencingRegion()21 virtual ~CircularGeofencingRegion() { } 22 latitude()23 double latitude() const { return m_webRegion.latitude; } longitude()24 double longitude() const { return m_webRegion.longitude; } radius()25 double radius() const { return m_webRegion.radius; } 26 27 WebCircularGeofencingRegion webRegion() const; 28 trace(Visitor * visitor)29 virtual void trace(Visitor* visitor) OVERRIDE { GeofencingRegion::trace(visitor); } 30 isCircularGeofencingRegion()31 virtual bool isCircularGeofencingRegion() const OVERRIDE { return true; } 32 33 private: 34 explicit CircularGeofencingRegion(const String& id, const WebCircularGeofencingRegion&); 35 36 WebCircularGeofencingRegion m_webRegion; 37 }; 38 39 DEFINE_TYPE_CASTS(CircularGeofencingRegion, GeofencingRegion, region, region->isCircularGeofencingRegion(), region.isCircularGeofencingRegion()); 40 41 } // namespace blink 42 43 #endif // CircularGeofencingRegion_h 44