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

Unified Diff: Source/modules/geofencing/GeofencingRegion.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: Created 6 years, 4 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/GeofencingRegion.cpp
diff --git a/Source/modules/geofencing/GeofencingRegion.cpp b/Source/modules/geofencing/GeofencingRegion.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..47bf00459d1a943289c266beb2c0295abdb416d1
--- /dev/null
+++ b/Source/modules/geofencing/GeofencingRegion.cpp
@@ -0,0 +1,29 @@
+// 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/GeofencingRegion.h"
+
+#include "modules/geofencing/CircularRegion.h"
+#include "public/platform/WebCircularRegion.h"
+
+namespace blink {
+
+GeofencingRegion* GeofencingRegion::createFromWebRegion(const WebGeofencingRegion& region)
+{
+ switch (region.regionType()) {
+ case WebGeofencingRegion::CircularRegionType:
+ return new CircularRegion(region.toConst<WebCircularRegion>());
+ default:
+ ASSERT_NOT_REACHED();
esprehn 2014/08/19 01:15:59 Don't add a default case, if you leave it out then
Marijn Kruisselbrink 2014/08/19 18:55:14 Done.
+ }
+ return 0;
+}
+
+bool GeofencingRegion::isCircularRegion() const
+{
+ return m_region.regionType() == WebGeofencingRegion::CircularRegionType;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698