Web Inspector: Geolocation override
authorkpiascik@rim.com <kpiascik@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 00:29:03 +0000 (00:29 +0000)
committerkpiascik@rim.com <kpiascik@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 00:29:03 +0000 (00:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89365

Source/WebCore:

Reviewed by Pavel Feldman.

Reverted original patch.
Change has not been reviewed by the right people. It declares
public protocol methods and is wrong in several ways.

* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::positionChanged):
* Modules/geolocation/GeolocationController.h:
(GeolocationController):
* inspector/Inspector.json:
* inspector/InspectorInstrumentation.cpp:
(WebCore):
* inspector/InspectorInstrumentation.h:
(WebCore):
(InspectorInstrumentation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::InspectorPageAgent):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.UserAgentSettingsTab):
(WebInspector.UserAgentSettingsTab.prototype._createDeviceMetricsElement):
* inspector/front-end/UserAgentSupport.js:

LayoutTests:

Reviewed by Pavel Feldman.
Change has not been reviewed by the right people. It declares
public protocol methods and is wrong in several ways.

Reverted original patch.

* inspector/geolocation-error-expected.txt: Removed.
* inspector/geolocation-error.html: Removed.
* inspector/geolocation-success-expected.txt: Removed.
* inspector/geolocation-success.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122532 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/geolocation-error-expected.txt [deleted file]
LayoutTests/inspector/geolocation-error.html [deleted file]
LayoutTests/inspector/geolocation-success-expected.txt [deleted file]
LayoutTests/inspector/geolocation-success.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/GeolocationController.cpp
Source/WebCore/Modules/geolocation/GeolocationController.h
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/inspector/front-end/Settings.js
Source/WebCore/inspector/front-end/SettingsScreen.js
Source/WebCore/inspector/front-end/UserAgentSupport.js

index cc18bd3..d1c692f 100644 (file)
@@ -1,3 +1,19 @@
+2012-07-12  Konrad Piascik  <kpiascik@rim.com>
+
+        Web Inspector: Geolocation override
+        https://bugs.webkit.org/show_bug.cgi?id=89365
+
+        Reviewed by Pavel Feldman.
+        Change has not been reviewed by the right people. It declares
+        public protocol methods and is wrong in several ways.
+
+        Reverted original patch.
+
+        * inspector/geolocation-error-expected.txt: Removed.
+        * inspector/geolocation-error.html: Removed.
+        * inspector/geolocation-success-expected.txt: Removed.
+        * inspector/geolocation-success.html: Removed.
+
 2012-07-12  Adrienne Walker  <enne@google.com>
 
         [chromium] Root invalidations for RTL pages need to be in the right space
diff --git a/LayoutTests/inspector/geolocation-error-expected.txt b/LayoutTests/inspector/geolocation-error-expected.txt
deleted file mode 100644 (file)
index 6ba4b83..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONSOLE MESSAGE: line 1: Error: 2
-CONSOLE MESSAGE: line 1: lat: 51.478, long: -0.166
-
diff --git a/LayoutTests/inspector/geolocation-error.html b/LayoutTests/inspector/geolocation-error.html
deleted file mode 100644 (file)
index f6676cb..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script>
-
-var mockLatitude = 51.478;
-var mockLongitude = -0.166;
-var mockAccuracy = 100;
-
-if (window.testRunner) {
-    testRunner.setGeolocationPermission(true);
-    testRunner.setMockGeolocationPosition(mockLatitude,
-                                                    mockLongitude,
-                                                    mockAccuracy);
-} else
-    debug('This test can not be run without the LayoutTestController');
-
-function test()
-{
-    function callbackComplete()
-    {
-        InspectorTest.completeTest();
-    }
-    function callback()
-    {
-        PageAgent.clearGeolocationData();
-        InspectorTest.evaluateInPage("navigator.geolocation.getCurrentPosition(function(pos){console.log('lat: ' + pos.coords.latitude + ',' + ' long: ' + pos.coords.longitude);}, function(err){console.log(err);}, [])", callbackComplete);
-    }
-    PageAgent.setGeolocationData(0, 0, 0, "PositionUnavailable");
-    InspectorTest.evaluateInPage("navigator.geolocation.getCurrentPosition(function(pos){console.log(pos);}, function(err){console.log('Error: ' + err.code);}, [])", callback);
-}
-
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-</p>
-
-</body>
-</html>
diff --git a/LayoutTests/inspector/geolocation-success-expected.txt b/LayoutTests/inspector/geolocation-success-expected.txt
deleted file mode 100644 (file)
index 772d2ae..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-CONSOLE MESSAGE: line 1: lat: 43.476093, long: -80.540299
-CONSOLE MESSAGE: line 1: lat: 51.478, long: -0.166
-
diff --git a/LayoutTests/inspector/geolocation-success.html b/LayoutTests/inspector/geolocation-success.html
deleted file mode 100644 (file)
index 418df62..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script>
-
-var mockLatitude = 51.478;
-var mockLongitude = -0.166;
-var mockAccuracy = 100;
-
-if (window.testRunner) {
-    testRunner.setGeolocationPermission(true);
-    testRunner.setMockGeolocationPosition(mockLatitude,
-                                                    mockLongitude,
-                                                    mockAccuracy);
-} else
-    debug('This test can not be run without the LayoutTestController');
-
-function test()
-{
-    function callbackComplete()
-    {
-        InspectorTest.completeTest();
-    }
-    function callback()
-    {
-        PageAgent.clearGeolocationData();
-        InspectorTest.evaluateInPage("navigator.geolocation.getCurrentPosition(function(pos){console.log('lat: ' + pos.coords.latitude + ',' + ' long: ' + pos.coords.longitude);}, function(err){console.log(err);}, [])", callbackComplete);
-    }
-    PageAgent.setGeolocationData(43.476093, -80.540299, 150, "None");
-    InspectorTest.evaluateInPage("navigator.geolocation.getCurrentPosition(function(pos){console.log('lat: ' + pos.coords.latitude + ',' + ' long: ' + pos.coords.longitude);}, function(err){console.log(err);}, [])", callback);
-}
-
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-</p>
-
-</body>
-</html>
index 582cb4c..d74101e 100644 (file)
@@ -1,3 +1,34 @@
+2012-07-12  Konrad Piascik  <kpiascik@rim.com>
+
+        Web Inspector: Geolocation override
+        https://bugs.webkit.org/show_bug.cgi?id=89365
+
+        Reviewed by Pavel Feldman.
+
+        Reverted original patch.
+        Change has not been reviewed by the right people. It declares
+        public protocol methods and is wrong in several ways.
+
+        * Modules/geolocation/GeolocationController.cpp:
+        (WebCore::GeolocationController::GeolocationController):
+        (WebCore::GeolocationController::positionChanged):
+        * Modules/geolocation/GeolocationController.h:
+        (GeolocationController):
+        * inspector/Inspector.json:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore):
+        (InspectorInstrumentation):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::InspectorPageAgent):
+        * inspector/InspectorPageAgent.h:
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/SettingsScreen.js:
+        (WebInspector.UserAgentSettingsTab):
+        (WebInspector.UserAgentSettingsTab.prototype._createDeviceMetricsElement):
+        * inspector/front-end/UserAgentSupport.js:
+
 2012-07-12  Ryosuke Niwa  <rniwa@webkit.org>
 
         Move m_type and m_hasNameCache from HTMLCollectionCacheBase to DynamicNodeListCacheBase for better bit packing
index 6ff08d6..e1ace93 100644 (file)
 
 #include "GeolocationClient.h"
 #include "GeolocationPosition.h"
-#include "InspectorInstrumentation.h"
 
 namespace WebCore {
 
-GeolocationController::GeolocationController(Page* page, GeolocationClient* client)
+GeolocationController::GeolocationController(Page*, GeolocationClient* client)
     : m_client(client)
-    , m_page(page)
 {
 }
 
@@ -100,9 +98,6 @@ void GeolocationController::cancelPermissionRequest(Geolocation* geolocation)
 
 void GeolocationController::positionChanged(GeolocationPosition* position)
 {
-    position = InspectorInstrumentation::checkGeolocationPositionOrError(m_page, position);
-    if (!position)
-        return;
     m_lastPosition = position;
     Vector<RefPtr<Geolocation> > observersVector;
     copyToVector(m_observers, observersVector);
index bc61b9e..fc3b513 100644 (file)
@@ -68,7 +68,6 @@ private:
     GeolocationController(Page*, GeolocationClient*);
 
     GeolocationClient* m_client;
-    Page* m_page;
 
     RefPtr<GeolocationPosition> m_lastPosition;
     typedef HashSet<RefPtr<Geolocation> > ObserversSet;
index 83f8319..d178d9d 100644 (file)
                 "parameters": [
                     { "name": "value", "type": "boolean", "description": "Whether script execution should be disabled in the page." }
                 ]
-            },
-            {
-                "name": "setGeolocationData",
-                "description": "overrides the GeolocationPosition or GeolocationError in the GeolocationController.",
-                "parameters": [
-                    { "name": "longitude", "type": "number", "optional": true, "description": "Mock longitude"},
-                    { "name": "latitude", "type": "number", "optional": true, "description": "Mock latitude"},
-                    { "name": "accuracy", "type": "number", "optional": true, "description": "Mock accuracy"},
-                    { "name": "errorType", "type": "string", "optional": true, "enum": ["PermissionDenied", "PositionUnavailable"], "description": "Error type"}
-                ]
-            },
-            {
-                "name": "clearGeolocationData",
-                "description": "clears the overriden GeolocationPosition and GeolocationError."
             }
         ],
         "events": [
index dadd599..325a4c4 100644 (file)
@@ -1186,19 +1186,6 @@ InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForNonDocument
 }
 #endif
 
-#if ENABLE(GEOLOCATION)
-GeolocationPosition* InspectorInstrumentation::checkGeolocationPositionOrErrorImpl(InstrumentingAgents* instrumentingAgents, GeolocationPosition* position)
-{
-    if (InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent()) {
-        if (pageAgent->sendGeolocationError())
-            return 0;
-        if (pageAgent->geolocationPosition())
-            position = pageAgent->geolocationPosition();
-    }
-    return position;
-}
-#endif
-
 } // namespace WebCore
 
 #endif // !ENABLE(INSPECTOR)
index 16fd159..4350e9c 100644 (file)
@@ -56,7 +56,6 @@ class Database;
 class Element;
 class EventContext;
 class DocumentLoader;
-class GeolocationPosition;
 class GraphicsContext;
 class HitTestResult;
 class InspectorCSSAgent;
@@ -261,10 +260,6 @@ public:
     static bool collectingHTMLParseErrors(Page*) { return false; }
 #endif
 
-#if ENABLE(GEOLOCATION)
-    static GeolocationPosition* checkGeolocationPositionOrError(Page*, GeolocationPosition*);
-#endif
-
 private:
 #if ENABLE(INSPECTOR)
     static WTF::ThreadSpecific<InspectorTimelineAgent*>& threadSpecificTimelineAgentForOrphanEvents();
@@ -426,10 +421,6 @@ private:
     static void cancelPauseOnNativeEvent(InstrumentingAgents*);
     static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
 
-#if ENABLE(GEOLOCATION)
-    static GeolocationPosition* checkGeolocationPositionOrErrorImpl(InstrumentingAgents*, GeolocationPosition*);
-#endif
-
     static int s_frontendCounter;
 #endif
 };
@@ -1395,19 +1386,6 @@ inline void InspectorInstrumentation::didFireAnimationFrame(const InspectorInstr
 #endif
 }
 
-
-#if ENABLE(GEOLOCATION)
-inline GeolocationPosition* InspectorInstrumentation::checkGeolocationPositionOrError(Page* page, GeolocationPosition* position)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(position);
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        return checkGeolocationPositionOrErrorImpl(instrumentingAgents, position);
-#endif
-    return position;
-}
-#endif
-
 #if ENABLE(INSPECTOR)
 inline bool InspectorInstrumentation::collectingHTMLParseErrors(Page* page)
 {
index aed0841..4e06a43 100644 (file)
@@ -51,9 +51,6 @@
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameView.h"
-#include "GeolocationController.h"
-#include "GeolocationError.h"
-#include "GeolocationPosition.h"
 #include "HTMLFrameOwnerElement.h"
 #include "HTMLNames.h"
 #include "IdentifiersFactory.h"
@@ -321,8 +318,6 @@ InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents,
     , m_lastScriptIdentifier(0)
     , m_lastPaintContext(0)
     , m_didLoadEventFire(false)
-    , m_geolocationError()
-    , m_geolocationPosition()
 {
 }
 
@@ -972,52 +967,6 @@ void InspectorPageAgent::updateViewMetrics(int width, int height, double fontSca
     InspectorInstrumentation::mediaQueryResultChanged(document);
 }
 
-void InspectorPageAgent::setGeolocationData(ErrorString*, const double* longitude, const double* latitude, const double* accuracy, const String* errorType)
-{
-#if ENABLE (GEOLOCATION)
-    GeolocationController* controller = GeolocationController::from(m_page);
-    if (!controller)
-        return;
-
-    clearGeolocationData(0);
-
-    if (*errorType == "PermissionDenied")
-        m_geolocationError = GeolocationError::create(GeolocationError::PermissionDenied, *errorType).leakRef();
-    else if (*errorType == "PositionUnavailable")
-        m_geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, *errorType).leakRef();
-
-    if (m_geolocationError.get()) {
-        controller->errorOccurred(m_geolocationError.get());
-        return;
-    }
-
-    m_geolocationPosition = GeolocationPosition::create(currentTimeMS(), *longitude, *latitude, *accuracy).leakRef();
-    controller->positionChanged(m_geolocationPosition.get());
-#endif
-}
-
-void InspectorPageAgent::clearGeolocationData(ErrorString*)
-{
-#if ENABLE(GEOLOCATION)
-    m_geolocationError.clear();
-    m_geolocationPosition.clear();
-#endif
-}
-
-bool InspectorPageAgent::sendGeolocationError()
-{
-#if ENABLE(GEOLOCATION)
-    if (m_geolocationError.get()) {
-        GeolocationController* controller = GeolocationController::from(m_page);
-        if (controller) {
-            controller->errorOccurred(m_geolocationError.get());
-            return true;
-        }
-    }
-#endif
-    return false;
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index c2f84f4..964bc85 100644 (file)
@@ -34,8 +34,6 @@
 #if ENABLE(INSPECTOR)
 
 #include "Frame.h"
-#include "GeolocationError.h"
-#include "GeolocationPosition.h"
 #include "InspectorBaseAgent.h"
 #include "InspectorFrontend.h"
 #include "PlatformString.h"
@@ -110,12 +108,6 @@ public:
     virtual void setShowPaintRects(ErrorString*, bool show);
     virtual void getScriptExecutionStatus(ErrorString*, PageCommandHandler::Result::Enum*);
     virtual void setScriptExecutionDisabled(ErrorString*, bool);
-    virtual void setGeolocationData(ErrorString*, const double*, const double*, const double*, const String*);
-    virtual void clearGeolocationData(ErrorString*);
-
-    // Geolocation override helpers.
-    bool sendGeolocationError();
-    GeolocationPosition* geolocationPosition() const {return m_geolocationPosition.get();}
 
     // InspectorInstrumentation API
     void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
@@ -164,8 +156,6 @@ private:
     GraphicsContext* m_lastPaintContext;
     LayoutRect m_lastPaintRect;
     bool m_didLoadEventFire;
-    RefPtr<GeolocationError> m_geolocationError;
-    RefPtr<GeolocationPosition> m_geolocationPosition;
 };
 
 
index 19c143a..a37829d 100644 (file)
@@ -99,8 +99,6 @@ WebInspector.Settings = function()
     this.zoomLevel = this.createSetting("zoomLevel", 0);
     this.savedURLs = this.createSetting("savedURLs", {});
     this.javaScriptDisabled = this.createSetting("javaScriptDisabled", false);
-    this.geolocationOverride = this.createSetting("geolocationOverride", "");
-    this.geolocationError = this.createSetting("geolocationError", "None");
 
     // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
     // periodical breakpoints duplication leading to inspector slowness.
index f639227..6876e86 100644 (file)
@@ -349,7 +349,6 @@ WebInspector.UserAgentSettingsTab = function()
     p.appendChild(this._createUserAgentControl());
     if (Capabilities.canOverrideDeviceMetrics)
         p.appendChild(this._createDeviceMetricsControl());
-    p.appendChild(this._createGeolocationOverrideControl());
     p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Emulate touch events"), WebInspector.settings.emulateTouchEvents));
 }
 
@@ -650,115 +649,6 @@ WebInspector.UserAgentSettingsTab.prototype = {
         cellElement.appendChild(this._createCheckboxSetting(WebInspector.UIString("Fit in window"), WebInspector.settings.deviceFitWindow, true, this._fitWindowCheckboxElement));
 
         return fieldsetElement;
-    },
-
-    _createGeolocationOverrideControl: function()
-    {
-        const geolocationSetting = WebInspector.settings.geolocationOverride.get();
-        var geolocation = WebInspector.UserAgentSupport.GeolocationPosition.parseSetting(geolocationSetting);
-
-        const p = document.createElement("p");
-        const labelElement = p.createChild("label");
-        const checkboxElement = labelElement.createChild("input");
-        checkboxElement.id = "geolocation-override-checkbox";
-        checkboxElement.type = "checkbox";
-        checkboxElement.checked = !geolocation || (geolocation._latitude && geolocation._longitude);
-        checkboxElement.addEventListener("click", this._onGeolocationOverrideCheckboxClicked.bind(this), false);
-        this._geolocationOverrideCheckboxElement = checkboxElement;
-        labelElement.appendChild(document.createTextNode(WebInspector.UIString("Override Geolocation")));
-
-        const geolocationSectionElement = this._createGeolocationOverrideElement(geolocation);
-        p.appendChild(geolocationSectionElement);
-
-        const geolocationErrorElement = this._createRadioSetting(WebInspector.UIString("Geolocation Error"), [
-        [ "None", WebInspector.UIString("None") ],
-        [ "PermissionDenied", WebInspector.UIString("PermissionDenied") ],
-        [ "PositionUnavailable", WebInspector.UIString("PositionUnavailable") ] ], WebInspector.settings.geolocationError);
-        p.appendChild(geolocationErrorElement);
-        this._geolocationErrorElement = geolocationErrorElement;
-        this._geolocationSectionElement = geolocationSectionElement;
-
-        this._setGeolocationPosition(geolocation, false, true);
-
-        return p;
-    },
-
-    _onGeolocationOverrideCheckboxClicked: function()
-    {
-        if (this._geolocationOverrideCheckboxElement.checked) {
-            this._geolocationSectionElement.removeStyleClass("hidden");
-            this._geolocationErrorElement.removeStyleClass("hidden");
-            var geolocation = WebInspector.UserAgentSupport.GeolocationPosition.parseUserInput(this._latitudeElement.value, this._longitudeElement.value);
-            if (geolocation)
-                this._setGeolocationPosition(geolocation, false, false);
-            if (!this._latitudeElement.value)
-                this._latitudeElement.focus();
-        } else {
-            this._geolocationSectionElement.addStyleClass("hidden");
-            this._geolocationErrorElement.addStyleClass("hidden");
-            PageAgent.clearGeolocationData();
-        }
-    },
-
-    _applyGeolocationUserInput: function()
-    {
-        this._setGeolocationPosition(WebInspector.UserAgentSupport.GeolocationPosition.parseUserInput(this._latitudeElement.value.trim(), this._longitudeElement.value.trim()), true, false);
-    },
-
-    /**
-     * @param {?WebInspector.UserAgentSupport.GeolocationPosition} geolocation
-     * @param {boolean} userInputModified
-     * @param {boolean} updateCheckbox
-     */
-    _setGeolocationPosition: function(geolocation, userInputModified, updateCheckbox)
-    {
-        if (!geolocation)
-            return;
-
-        if (!userInputModified) {
-            this._latitudeElement.value = geolocation._latitude;
-            this._longitudeElement.value = geolocation._longitude;
-        }
-
-        var value = geolocation.toSetting();
-        WebInspector.settings.geolocationOverride.set(value);
-
-        if (this._geolocationOverrideCheckboxElement && updateCheckbox) {
-            this._geolocationOverrideCheckboxElement.checked = !!geolocation.toSetting();
-            this._onGeolocationOverrideCheckboxClicked();
-        }
-    },
-
-    /**
-     * @param {WebInspector.UserAgentSupport.GeolocationPosition} geolocation
-     */
-    _createGeolocationOverrideElement: function(geolocation)
-    {
-        var fieldsetElement = document.createElement("fieldset");
-        fieldsetElement.id = "geolocation-override-section";
-
-        function createInput(parentElement, id, defaultText)
-        {
-            var element = parentElement.createChild("input");
-            element.id = id;
-            element.maxLength = 12;
-            element.style.width = "80px";
-            element.value = defaultText;
-            element.addEventListener("blur", this._applyGeolocationUserInput.bind(this), false);
-            return element;
-        }
-
-        var tableElement = fieldsetElement.createChild("table");
-
-        var rowElement = tableElement.createChild("tr");
-        var cellElement = rowElement.createChild("td");
-        cellElement.appendChild(document.createTextNode(WebInspector.UIString("Geolocation Position:")));
-        cellElement = rowElement.createChild("td");
-        this._latitudeElement = createInput.call(this, cellElement, "geolocation-override-latitude", String(geolocation._latitude));
-        cellElement.appendChild(document.createTextNode(" , "));
-        this._longitudeElement = createInput.call(this, cellElement, "geolocation-override-longitude", String(geolocation._longitude));
-
-        return fieldsetElement;
     }
 }
 
index d17d288..976b507 100644 (file)
@@ -37,8 +37,6 @@ WebInspector.UserAgentSupport = function()
         this._deviceMetricsChanged();
     WebInspector.settings.deviceMetrics.addChangeListener(this._deviceMetricsChanged, this);
     WebInspector.settings.deviceFitWindow.addChangeListener(this._deviceMetricsChanged, this);
-    WebInspector.settings.geolocationOverride.addChangeListener(this._geolocationPositionChanged, this);
-    WebInspector.settings.geolocationError.addChangeListener(this._onGeolocationErrorChanged, this);
 }
 
 /**
@@ -165,88 +163,11 @@ WebInspector.UserAgentSupport.DeviceMetrics.prototype = {
     }
 }
 
-/**
- * @constructor
- * @param {number} latitude
- * @param {number} longitude
- */
-WebInspector.UserAgentSupport.GeolocationPosition = function (latitude, longitude)
-{
-    this._latitude = latitude;
-    this._longitude = longitude;
-}
-
-WebInspector.UserAgentSupport.GeolocationPosition.prototype = {
-    /**
-     * @return {string}
-     */
-    toSetting: function()
-    {
-        return (this._latitude || this._latitude == 0) && (this._longitude || this._longitude == 0) ? this._latitude + "@" + this._longitude : "";
-    }
-}
-
-/**
- * @return {WebInspector.UserAgentSupport.GeolocationPosition}
- */
-WebInspector.UserAgentSupport.GeolocationPosition.parseSetting = function(value)
-{
-    if (value) {
-        var splitPosition = value.split("@");
-        if (splitPosition.length === 2)
-            return new WebInspector.UserAgentSupport.GeolocationPosition(parseFloat(splitPosition[0]), parseFloat(splitPosition[1]));
-    }
-    return new WebInspector.UserAgentSupport.GeolocationPosition(0, 0);
-}
-
-/**
- * @return {?WebInspector.UserAgentSupport.GeolocationPosition}
- */
-WebInspector.UserAgentSupport.GeolocationPosition.parseUserInput = function(latitudeString, longitudeString)
-{
-    function isUserInputValid(value)
-    {
-        if (!value)
-            return true;
-        return /^[-]?[0-9]*[.]?[0-9]*$/.test(value);
-    }
-
-    if (!latitudeString ^ !latitudeString)
-        return null;
-
-    var isLatitudeValid = isUserInputValid(latitudeString);
-    var isLongitudeValid = isUserInputValid(longitudeString);
-
-    if (!isLatitudeValid && !isLongitudeValid)
-        return null;
-
-    var latitude = isLatitudeValid ? parseFloat(latitudeString) : -1;
-    var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1;
-
-    return new WebInspector.UserAgentSupport.GeolocationPosition(latitude, longitude);
-}
-
 WebInspector.UserAgentSupport.prototype = {
     _deviceMetricsChanged: function()
     {
         var metrics = WebInspector.UserAgentSupport.DeviceMetrics.parseSetting(WebInspector.settings.deviceMetrics.get());
         if (metrics.isValid())
             PageAgent.setDeviceMetricsOverride(metrics.width, metrics.height, metrics.fontScaleFactor, WebInspector.settings.deviceFitWindow.get());
-    },
-
-    _geolocationPositionChanged: function(errorType)
-    {
-        var geolocation = WebInspector.UserAgentSupport.GeolocationPosition.parseSetting(WebInspector.settings.geolocationOverride.get());
-        PageAgent.setGeolocationData(geolocation._latitude, geolocation._longitude, 150, typeof errorType === 'string'? errorType : WebInspector.settings.geolocationError.get());
-    },
-
-    /**
-     * @param {WebInspector.Event} event
-     */
-    _onGeolocationErrorChanged: function(event)
-    {
-        this._geolocationPositionChanged(event.data);
-        console.log(event);
     }
 }
-