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

Unified Diff: chrome/browser/geolocation/mock_location_provider.h

Issue 6591034: Move core pieces of geolocation from chrome to content.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix Linux build Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/geolocation/mock_location_provider.h
===================================================================
--- chrome/browser/geolocation/mock_location_provider.h (revision 76198)
+++ chrome/browser/geolocation/mock_location_provider.h (working copy)
@@ -1,65 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_
-#define CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_
-#pragma once
-
-
-#include "base/ref_counted.h"
-#include "base/scoped_ptr.h"
-#include "base/threading/thread.h"
-#include "chrome/browser/geolocation/location_provider.h"
-#include "chrome/common/geoposition.h"
-#include "googleurl/src/gurl.h"
-
-// Mock implementation of a location provider for testing.
-class MockLocationProvider : public LocationProviderBase {
- public:
- // Will update |*self_ref| to point to |this| on construction, and to NULL
- // on destruction.
- explicit MockLocationProvider(MockLocationProvider** self_ref);
- ~MockLocationProvider();
-
- // Updates listeners with the new position.
- void HandlePositionChanged(const Geoposition& position);
-
- // LocationProviderBase implementation.
- virtual bool StartProvider(bool high_accuracy);
- virtual void StopProvider();
- virtual void GetPosition(Geoposition* position);
- virtual void OnPermissionGranted(const GURL& requesting_frame);
-
- Geoposition position_;
- enum { STOPPED, LOW_ACCURACY, HIGH_ACCURACY } state_;
- GURL permission_granted_url_;
- MockLocationProvider** self_ref_;
-
- scoped_refptr<base::MessageLoopProxy> provider_loop_;
-
- // Set when an instance of the mock is created via a factory function.
- static MockLocationProvider* instance_;
-
- DISALLOW_COPY_AND_ASSIGN(MockLocationProvider);
-};
-
-// Factory functions for the various sorts of mock location providers,
-// for use with GeolocationArbitrator::SetProviderFactoryForTest (i.e.
-// not intended for test code to use to get access to the mock, you can use
-// MockLocationProvider::instance_ for this, or make a custom factory method).
-
-// Creates a mock location provider with no default behavior.
-LocationProviderBase* NewMockLocationProvider();
-// Creates a mock location provider that automatically notifies its
-// listeners with a valid location when StartProvider is called.
-LocationProviderBase* NewAutoSuccessMockLocationProvider();
-// Creates a mock location provider that automatically notifies its
-// listeners with an error when StartProvider is called.
-LocationProviderBase* NewAutoFailMockLocationProvider();
-// Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of
-// the Network Location provider, in deferring making location updates until
-// a permission request has been confirmed.
-LocationProviderBase* NewAutoSuccessMockNetworkLocationProvider();
-
-#endif // CHROME_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698