OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
6 #define CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "base/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "chrome/browser/geolocation/location_provider.h" | 13 #include "chrome/browser/geolocation/location_provider.h" |
14 #include "chrome/common/geoposition.h" | 14 #include "chrome/common/geoposition.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 | 16 |
17 // Mock implementation of a location provider for testing. | 17 // Mock implementation of a location provider for testing. |
18 class MockLocationProvider : public LocationProviderBase { | 18 class MockLocationProvider : public LocationProviderBase { |
19 public: | 19 public: |
20 // Will update |*self_ref| to point to |this| on construction, and to NULL | 20 // Will update |*self_ref| to point to |this| on construction, and to NULL |
21 // on destruction. | 21 // on destruction. |
22 explicit MockLocationProvider(MockLocationProvider** self_ref); | 22 explicit MockLocationProvider(MockLocationProvider** self_ref); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 LocationProviderBase* NewAutoSuccessMockLocationProvider(); | 56 LocationProviderBase* NewAutoSuccessMockLocationProvider(); |
57 // Creates a mock location provider that automatically notifies its | 57 // Creates a mock location provider that automatically notifies its |
58 // listeners with an error when StartProvider is called. | 58 // listeners with an error when StartProvider is called. |
59 LocationProviderBase* NewAutoFailMockLocationProvider(); | 59 LocationProviderBase* NewAutoFailMockLocationProvider(); |
60 // Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of | 60 // Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of |
61 // the Network Location provider, in deferring making location updates until | 61 // the Network Location provider, in deferring making location updates until |
62 // a permission request has been confirmed. | 62 // a permission request has been confirmed. |
63 LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider(); | 63 LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider(); |
64 | 64 |
65 #endif // CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ | 65 #endif // CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
OLD | NEW |