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.
6 #include "modules/geofencing/NavigatorGeofencing.h"
8 #include "core/frame/Navigator.h"
9 #include "modules/geofencing/Geofencing.h"
13 NavigatorGeofencing::NavigatorGeofencing()
17 NavigatorGeofencing::~NavigatorGeofencing()
21 const char* NavigatorGeofencing::supplementName()
23 return "NavigatorGeofencing";
26 NavigatorGeofencing& NavigatorGeofencing::from(Navigator& navigator)
28 NavigatorGeofencing* supplement = static_cast<NavigatorGeofencing*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
30 supplement = new NavigatorGeofencing();
31 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
36 Geofencing* NavigatorGeofencing::geofencing(Navigator& navigator)
38 return NavigatorGeofencing::from(navigator).geofencing();
41 Geofencing* NavigatorGeofencing::geofencing()
44 m_geofencing = Geofencing::create();
45 return m_geofencing.get();
48 void NavigatorGeofencing::trace(Visitor* visitor)
50 visitor->trace(m_geofencing);
51 WillBeHeapSupplement<Navigator>::trace(visitor);