OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return null; | 171 return null; |
172 | 172 |
173 var latitude = isLatitudeValid ? parseFloat(latitudeString) : -1; | 173 var latitude = isLatitudeValid ? parseFloat(latitudeString) : -1; |
174 var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1; | 174 var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1; |
175 | 175 |
176 return new WebInspector.OverridesSupport.GeolocationPosition(latitude, longi
tude, errorStatus ? "PositionUnavailable" : ""); | 176 return new WebInspector.OverridesSupport.GeolocationPosition(latitude, longi
tude, errorStatus ? "PositionUnavailable" : ""); |
177 } | 177 } |
178 | 178 |
179 WebInspector.OverridesSupport.GeolocationPosition.clearGeolocationOverride = fun
ction() | 179 WebInspector.OverridesSupport.GeolocationPosition.clearGeolocationOverride = fun
ction() |
180 { | 180 { |
181 GeolocationAgent.clearGeolocationOverride(); | 181 PageAgent.clearGeolocationOverride(); |
182 } | 182 } |
183 | 183 |
184 /** | 184 /** |
185 * @constructor | 185 * @constructor |
186 * @param {number} alpha | 186 * @param {number} alpha |
187 * @param {number} beta | 187 * @param {number} beta |
188 * @param {number} gamma | 188 * @param {number} gamma |
189 */ | 189 */ |
190 WebInspector.OverridesSupport.DeviceOrientation = function(alpha, beta, gamma) | 190 WebInspector.OverridesSupport.DeviceOrientation = function(alpha, beta, gamma) |
191 { | 191 { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 }, | 639 }, |
640 | 640 |
641 _deviceMetricsOverrideAppliedForTest: function() | 641 _deviceMetricsOverrideAppliedForTest: function() |
642 { | 642 { |
643 // Used for sniffing in tests. | 643 // Used for sniffing in tests. |
644 }, | 644 }, |
645 | 645 |
646 _geolocationPositionChanged: function() | 646 _geolocationPositionChanged: function() |
647 { | 647 { |
648 if (!this.emulationEnabled() || !this.settings.overrideGeolocation.get()
) { | 648 if (!this.emulationEnabled() || !this.settings.overrideGeolocation.get()
) { |
649 GeolocationAgent.clearGeolocationOverride(); | 649 PageAgent.clearGeolocationOverride(); |
650 return; | 650 return; |
651 } | 651 } |
652 var geolocation = WebInspector.OverridesSupport.GeolocationPosition.pars
eSetting(this.settings.geolocationOverride.get()); | 652 var geolocation = WebInspector.OverridesSupport.GeolocationPosition.pars
eSetting(this.settings.geolocationOverride.get()); |
653 if (geolocation.error) | 653 if (geolocation.error) |
654 GeolocationAgent.setGeolocationOverride(); | 654 PageAgent.setGeolocationOverride(); |
655 else | 655 else |
656 GeolocationAgent.setGeolocationOverride(geolocation.latitude, geoloc
ation.longitude, 150); | 656 PageAgent.setGeolocationOverride(geolocation.latitude, geolocation.l
ongitude, 150); |
657 }, | 657 }, |
658 | 658 |
659 _deviceOrientationChanged: function() | 659 _deviceOrientationChanged: function() |
660 { | 660 { |
661 if (!this.emulationEnabled() || !this.settings.overrideDeviceOrientation
.get()) { | 661 if (!this.emulationEnabled() || !this.settings.overrideDeviceOrientation
.get()) { |
662 PageAgent.clearDeviceOrientationOverride(); | 662 PageAgent.clearDeviceOrientationOverride(); |
663 return; | 663 return; |
664 } | 664 } |
665 | 665 |
666 var deviceOrientation = WebInspector.OverridesSupport.DeviceOrientation.
parseSetting(this.settings.deviceOrientationOverride.get()); | 666 var deviceOrientation = WebInspector.OverridesSupport.DeviceOrientation.
parseSetting(this.settings.deviceOrientationOverride.get()); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 }, | 816 }, |
817 | 817 |
818 __proto__: WebInspector.Object.prototype | 818 __proto__: WebInspector.Object.prototype |
819 } | 819 } |
820 | 820 |
821 | 821 |
822 /** | 822 /** |
823 * @type {!WebInspector.OverridesSupport} | 823 * @type {!WebInspector.OverridesSupport} |
824 */ | 824 */ |
825 WebInspector.overridesSupport; | 825 WebInspector.overridesSupport; |
OLD | NEW |