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

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

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.cpp
diff --git a/Source/modules/geofencing/CircularGeofencingRegion.cpp b/Source/modules/geofencing/CircularGeofencingRegion.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ee9f7ab896fb14d56d67772687240a082daae032
--- /dev/null
+++ b/Source/modules/geofencing/CircularGeofencingRegion.cpp
@@ -0,0 +1,40 @@
+// 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.
+
+#include "config.h"
+#include "modules/geofencing/CircularGeofencingRegion.h"
+
+#include "bindings/core/v8/Dictionary.h"
+#include "public/platform/WebString.h"
+
+namespace blink {
+
+CircularGeofencingRegion* CircularGeofencingRegion::create(const Dictionary& dictionary)
+{
+ String id;
+ DictionaryHelper::get(dictionary, "id", id);
+ WebCircularGeofencingRegion region;
+ DictionaryHelper::get(dictionary, "latitude", region.latitude);
+ DictionaryHelper::get(dictionary, "longitude", region.longitude);
+ DictionaryHelper::get(dictionary, "radius", region.radius);
+ return new CircularGeofencingRegion(id, region);
+}
+
+CircularGeofencingRegion* CircularGeofencingRegion::create(const WebString& id, const WebCircularGeofencingRegion& region)
+{
+ return new CircularGeofencingRegion(id, region);
+}
+
+CircularGeofencingRegion::CircularGeofencingRegion(const String& id, const WebCircularGeofencingRegion& region)
+ : GeofencingRegion(id)
+ , m_webRegion(region)
+{
+}
+
+WebCircularGeofencingRegion CircularGeofencingRegion::webRegion() const
+{
+ return m_webRegion;
+}
+
+} // namespace blink
« no previous file with comments | « Source/modules/geofencing/CircularGeofencingRegion.h ('k') | Source/modules/geofencing/CircularGeofencingRegion.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698