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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js

Issue 1917543002: DevTools: Update styles for sensors drawer panel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor updates Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698