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#include "config.h"
6#include "modules/geofencing/CircularGeofencingRegion.h"
7
8#include "bindings/core/v8/Dictionary.h"
9#include "public/platform/WebString.h"
10
11namespace blink {
12
13CircularGeofencingRegion* CircularGeofencingRegion::create(const Dictionary& dictionary)
14{
15    String id;
16    DictionaryHelper::get(dictionary, "id", id);
17    WebCircularGeofencingRegion region;
18    DictionaryHelper::get(dictionary, "latitude", region.latitude);
19    DictionaryHelper::get(dictionary, "longitude", region.longitude);
20    DictionaryHelper::get(dictionary, "radius", region.radius);
21    return new CircularGeofencingRegion(id, region);
22}
23
24CircularGeofencingRegion* CircularGeofencingRegion::create(const WebString& id, const WebCircularGeofencingRegion& region)
25{
26    return new CircularGeofencingRegion(id, region);
27}
28
29CircularGeofencingRegion::CircularGeofencingRegion(const String& id, const WebCircularGeofencingRegion& region)
30    : GeofencingRegion(id)
31    , m_webRegion(region)
32{
33}
34
35WebCircularGeofencingRegion CircularGeofencingRegion::webRegion() const
36{
37    return m_webRegion;
38}
39
40} // namespace blink
41