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

Unified Diff: Source/modules/geofencing/CircularGeofencingRegion.h

Issue 464073002: Pass through geofencing API calls to the content layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test expectations Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/geofencing/CircularGeofencingRegion.h
diff --git a/Source/modules/geofencing/CircularGeofencingRegion.h b/Source/modules/geofencing/CircularGeofencingRegion.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c524d77a699e523fc8f6bc383a57e8419576409
--- /dev/null
+++ b/Source/modules/geofencing/CircularGeofencingRegion.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CircularGeofencingRegion_h
+#define CircularGeofencingRegion_h
+
+#include "modules/geofencing/GeofencingRegion.h"
+#include "public/platform/WebCircularGeofencingRegion.h"
+
+namespace blink {
+
+class Dictionary;
+
+class CircularGeofencingRegion FINAL : public GeofencingRegion {
+ DEFINE_WRAPPERTYPEINFO();
+ WTF_MAKE_NONCOPYABLE(CircularGeofencingRegion);
+public:
+ static CircularGeofencingRegion* create(const Dictionary& init);
+ static CircularGeofencingRegion* create(const WebString& id, const WebCircularGeofencingRegion&);
+ virtual ~CircularGeofencingRegion() { }
+
+ double latitude() const { return m_webRegion.latitude; }
+ double longitude() const { return m_webRegion.longitude; }
+ double radius() const { return m_webRegion.radius; }
+
+ WebCircularGeofencingRegion webRegion() const;
+
+ virtual void trace(Visitor* visitor) OVERRIDE { GeofencingRegion::trace(visitor); }
+
+ virtual bool isCircularGeofencingRegion() const OVERRIDE { return true; }
+
+private:
+ explicit CircularGeofencingRegion(const String& id, const WebCircularGeofencingRegion&);
+
+ WebCircularGeofencingRegion m_webRegion;
+};
+
+DEFINE_TYPE_CASTS(CircularGeofencingRegion, GeofencingRegion, region, region->isCircularGeofencingRegion(), region.isCircularGeofencingRegion());
+
+} // namespace blink
+
+#endif // CircularGeofencingRegion_h

Powered by Google App Engine
This is Rietveld 408576698