Index: third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js b/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
index 208ecdc2c6eda8924cd87acd225926875505b4f2..57b415a206b78dd076d3250fe6fd1145f7d28888 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
@@ -6,7 +6,7 @@ |
* @constructor |
* @param {number} latitude |
* @param {number} longitude |
- * @param {string} error |
+ * @param {boolean} error |
*/ |
WebInspector.Geolocation = function(latitude, longitude, error) |
{ |
@@ -30,8 +30,7 @@ WebInspector.Geolocation.prototype = { |
if (this.error) |
target.emulationAgent().setGeolocationOverride(); |
else |
- target.emulationAgent().setGeolocationOverride(this.latitude, this.longitude, 150); |
- |
+ target.emulationAgent().setGeolocationOverride(this.latitude, this.longitude, WebInspector.Geolocation.DefaultMockAccuracy); |
} |
}, |
@@ -55,10 +54,13 @@ WebInspector.Geolocation.parseSetting = function(value) |
return new WebInspector.Geolocation(parseFloat(splitPosition[0]), parseFloat(splitPosition[1]), splitError[1]); |
} |
} |
- return new WebInspector.Geolocation(0, 0, ""); |
+ return new WebInspector.Geolocation(0, 0, false); |
} |
/** |
+ * @param {string} latitudeString |
+ * @param {string} longitudeString |
+ * @param {string} errorStatus |
* @return {?WebInspector.Geolocation} |
*/ |
WebInspector.Geolocation.parseUserInput = function(latitudeString, longitudeString, errorStatus) |
@@ -74,8 +76,7 @@ WebInspector.Geolocation.parseUserInput = function(latitudeString, longitudeStri |
var latitude = isLatitudeValid ? parseFloat(latitudeString) : -1; |
var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1; |
- |
- return new WebInspector.Geolocation(latitude, longitude, errorStatus ? "PositionUnavailable" : ""); |
+ return new WebInspector.Geolocation(latitude, longitude, !!errorStatus); |
} |
/** |
@@ -95,3 +96,5 @@ WebInspector.Geolocation.longitudeValidator = function(value) |
{ |
return !value || (/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value >= -180 && value <= 180); |
} |
+ |
+WebInspector.Geolocation.DefaultMockAccuracy = 150; |