Web Inspector: Override the DeviceOrientation
authorkpiascik@rim.com <kpiascik@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Aug 2012 19:29:26 +0000 (19:29 +0000)
committerkpiascik@rim.com <kpiascik@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Aug 2012 19:29:26 +0000 (19:29 +0000)
commit74a29d5c72d703b9129093400a6981577189ed41
tree64436bc105ef954d52a32e8311082905a009e967
parentd36b13c0d2558f76f076c48395a688f449605499
Web Inspector: Override the DeviceOrientation
https://bugs.webkit.org/show_bug.cgi?id=91008

Reviewed by Pavel Feldman.

Source/WebCore:

Re-added the m_page member variable to DeviceOrientationController and
added InspectorInstrumentation to see if the DeviceOrientationData
should be overridden or not.

Added UI to the web inspector front-end to allow users to override the
device orientation.  This is currently hidden behind an experiment.

Test: inspector/device-orientation-success.html

* English.lproj/localizedStrings.js:
* dom/DeviceOrientationController.cpp:
(WebCore::DeviceOrientationController::DeviceOrientationController):
(WebCore::DeviceOrientationController::create):
(WebCore::DeviceOrientationController::didChangeDeviceOrientation):
(WebCore::provideDeviceOrientationTo):
* dom/DeviceOrientationController.h:
(DeviceOrientationController):
* inspector/Inspector.json:
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::overrideDeviceOrientationImpl):
* inspector/InspectorInstrumentation.h:
(WebCore):
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::overrideDeviceOrientation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setDeviceOrientationOverride):
(WebCore):
(WebCore::InspectorPageAgent::clearDeviceOrientationOverride):
(WebCore::InspectorPageAgent::canOverrideDeviceOrientation):
(WebCore::InspectorPageAgent::overrideDeviceOrientation):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
* inspector/front-end/SettingsScreen.js:
(WebInspector.UserAgentSettingsTab):
(WebInspector.UserAgentSettingsTab.prototype._createInput):
(WebInspector.UserAgentSettingsTab.prototype._createDeviceMetricsElement):
(WebInspector.UserAgentSettingsTab.prototype._createGeolocationOverrideElement):
(WebInspector.UserAgentSettingsTab.prototype._onDeviceOrientationOverrideCheckboxClicked):
(WebInspector.UserAgentSettingsTab.prototype._applyDeviceOrientationUserInput):
(WebInspector.UserAgentSettingsTab.prototype._setDeviceOrientation.set if):
(WebInspector.UserAgentSettingsTab.prototype._setDeviceOrientation):
(WebInspector.UserAgentSettingsTab.prototype._createDeviceOrientationOverrideElement):
* inspector/front-end/UserAgentSupport.js:
(WebInspector.UserAgentSupport.DeviceOrientation):
(WebInspector.UserAgentSupport.DeviceOrientation.prototype.toSetting):
(WebInspector.UserAgentSupport.DeviceOrientation.parseSetting):
(WebInspector.UserAgentSupport.DeviceOrientation.parseUserInput):
(WebInspector.UserAgentSupport.DeviceOrientation.clearDeviceOrientationOverride):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):

LayoutTests:

New tests for Device Orientation override.

* inspector/device-orientation-success-expected.txt: Added.
* inspector/device-orientation-success.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/device-orientation-success-expected.txt [new file with mode: 0644]
LayoutTests/inspector/device-orientation-success.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/dom/DeviceOrientationController.cpp
Source/WebCore/dom/DeviceOrientationController.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
Source/WebCore/inspector/front-end/inspector.js