OLD | NEW |
(Empty) | |
| 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 #ifndef CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ |
| 6 #define CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "content/browser/geofencing/geofencing_service.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class MockGeofencingService : public GeofencingService { |
| 15 public: |
| 16 MockGeofencingService(bool service_available); |
| 17 ~MockGeofencingService() override; |
| 18 |
| 19 void SetMockPosition(double latitude, double longitude); |
| 20 |
| 21 bool IsServiceAvailable() override; |
| 22 int64 RegisterRegion(const blink::WebCircularGeofencingRegion& region, |
| 23 GeofencingRegistrationDelegate* delegate) override; |
| 24 void UnregisterRegion(int64 geofencing_registration_id) override; |
| 25 |
| 26 private: |
| 27 struct Registration; |
| 28 |
| 29 bool available_; |
| 30 std::map<int64, Registration> registrations_; |
| 31 int64 next_id_; |
| 32 bool has_position_; |
| 33 double last_latitude_; |
| 34 double last_longitude_; |
| 35 }; |
| 36 |
| 37 } // namespace content |
| 38 |
| 39 #endif // CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ |
OLD | NEW |