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

Side by Side Diff: Source/modules/geofencing/NavigatorGeofencing.cpp

Issue 401713005: Move all geofencing code into its own module separate from geolocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update test expectations 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/push_messaging/NavigatorPushManager.h" 6 #include "modules/geofencing/NavigatorGeofencing.h"
7 7
8 #include "core/frame/Navigator.h" 8 #include "core/frame/Navigator.h"
9 #include "modules/push_messaging/PushManager.h" 9 #include "modules/geofencing/Geofencing.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 NavigatorPushManager::NavigatorPushManager() 13 NavigatorGeofencing::NavigatorGeofencing()
14 { 14 {
15 } 15 }
16 16
17 NavigatorPushManager::~NavigatorPushManager() 17 NavigatorGeofencing::~NavigatorGeofencing()
18 { 18 {
19 } 19 }
20 20
21 const char* NavigatorPushManager::supplementName() 21 const char* NavigatorGeofencing::supplementName()
22 { 22 {
23 return "NavigatorPushManager"; 23 return "NavigatorGeofencing";
24 } 24 }
25 25
26 NavigatorPushManager& NavigatorPushManager::from(Navigator& navigator) 26 NavigatorGeofencing& NavigatorGeofencing::from(Navigator& navigator)
27 { 27 {
28 NavigatorPushManager* supplement = static_cast<NavigatorPushManager*>(WillBe HeapSupplement<Navigator>::from(navigator, supplementName())); 28 NavigatorGeofencing* supplement = static_cast<NavigatorGeofencing*>(WillBeHe apSupplement<Navigator>::from(navigator, supplementName()));
29 if (!supplement) { 29 if (!supplement) {
30 supplement = new NavigatorPushManager(); 30 supplement = new NavigatorGeofencing();
31 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); 31 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
32 } 32 }
33 return *supplement; 33 return *supplement;
34 } 34 }
35 35
36 PushManager* NavigatorPushManager::push(Navigator& navigator) 36 Geofencing* NavigatorGeofencing::geofencing(Navigator& navigator)
37 { 37 {
38 return NavigatorPushManager::from(navigator).pushManager(); 38 return NavigatorGeofencing::from(navigator).geofencing();
39 } 39 }
40 40
41 PushManager* NavigatorPushManager::pushManager() 41 Geofencing* NavigatorGeofencing::geofencing()
42 { 42 {
43 if (!m_pushManager) 43 if (!m_geofencing)
44 m_pushManager = PushManager::create(); 44 m_geofencing = Geofencing::create();
45 return m_pushManager.get(); 45 return m_geofencing.get();
46 } 46 }
47 47
48 void NavigatorPushManager::trace(Visitor* visitor) 48 void NavigatorGeofencing::trace(Visitor* visitor)
49 { 49 {
50 visitor->trace(m_pushManager); 50 visitor->trace(m_geofencing);
51 WillBeHeapSupplement<Navigator>::trace(visitor); 51 WillBeHeapSupplement<Navigator>::trace(visitor);
52 } 52 }
53 53
54 } // namespace blink 54 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/geofencing/NavigatorGeofencing.h ('k') | Source/modules/geofencing/NavigatorGeofencing.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698