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

Side by Side Diff: content/browser/geolocation/mock_location_provider.h

Issue 10103029: Add device location reporting (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Forgot to exclude CrOS-only sources from build on other OSes. Created 8 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ 5 #ifndef CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_
6 #define CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ 6 #define CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
12 #include "base/threading/thread.h" 11 #include "base/message_loop_proxy.h"
13 #include "content/browser/geolocation/location_provider.h" 12 #include "content/browser/geolocation/location_provider.h"
14 #include "content/common/geoposition.h" 13 #include "content/common/geoposition.h"
15 14
16 // Mock implementation of a location provider for testing. 15 // Mock implementation of a location provider for testing.
17 class MockLocationProvider : public LocationProviderBase { 16 class MockLocationProvider : public LocationProviderBase {
18 public: 17 public:
19 // Will update |*self_ref| to point to |this| on construction, and to NULL 18 // Will update |*self_ref| to point to |this| on construction, and to NULL
20 // on destruction. 19 // on destruction.
21 explicit MockLocationProvider(MockLocationProvider** self_ref); 20 explicit MockLocationProvider(MockLocationProvider** self_ref);
22 virtual ~MockLocationProvider(); 21 virtual ~MockLocationProvider();
(...skipping 30 matching lines...) Expand all
53 // Creates a mock location provider that automatically notifies its 52 // Creates a mock location provider that automatically notifies its
54 // listeners with a valid location when StartProvider is called. 53 // listeners with a valid location when StartProvider is called.
55 LocationProviderBase* NewAutoSuccessMockLocationProvider(); 54 LocationProviderBase* NewAutoSuccessMockLocationProvider();
56 // Creates a mock location provider that automatically notifies its 55 // Creates a mock location provider that automatically notifies its
57 // listeners with an error when StartProvider is called. 56 // listeners with an error when StartProvider is called.
58 LocationProviderBase* NewAutoFailMockLocationProvider(); 57 LocationProviderBase* NewAutoFailMockLocationProvider();
59 // Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of 58 // Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of
60 // the Network Location provider, in deferring making location updates until 59 // the Network Location provider, in deferring making location updates until
61 // a permission request has been confirmed. 60 // a permission request has been confirmed.
62 LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider(); 61 LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider();
62 // Similar to NewAutoFailMockLocationProvider but mimicks the behavior of
63 // the Network Location provider, in deferring making location updates until
64 // a permission request has been confirmed.
65 LocationProviderBase* NewAutoFailMockNetworkLocationProvider();
63 66
64 #endif // CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ 67 #endif // CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698