Chromium Code Reviews| 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 |