Changeset 63750 in webkit
- Timestamp:
- Jul 20, 2010 10:08:31 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63747 r63750 1 2010-07-20 Hans Wennborg <hans@chromium.org> 2 3 Reviewed by Steve Block. 4 5 Runtime feature switch for device orientation 6 https://bugs.webkit.org/show_bug.cgi?id=42265 7 8 Add a runtime feature switch that decides whether device orientation 9 events are available or not. Defaults to true. 10 11 * bindings/generic/RuntimeEnabledFeatures.cpp: 12 * bindings/generic/RuntimeEnabledFeatures.h: 13 (WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled): 14 (WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled): 15 (WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled): 16 (WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled): 17 * page/DOMWindow.cpp: 18 (WebCore::DOMWindow::addEventListener): 19 (WebCore::DOMWindow::removeEventListener): 20 (WebCore::DOMWindow::removeAllEventListeners): 21 * page/DOMWindow.idl: 22 * page/Page.cpp: 23 (WebCore::Page::Page): 24 1 25 2010-07-20 Hayato Ito <hayato@chromium.org> 2 26 -
trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
r62920 r63750 48 48 bool RuntimeEnabledFeatures::isPushStateEnabled = false; 49 49 bool RuntimeEnabledFeatures::isTouchEnabled = true; 50 bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true; 50 51 51 52 #if ENABLE(VIDEO) -
trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.h
r62920 r63750 114 114 #endif 115 115 116 static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; } 117 static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; } 118 static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; } 119 static bool ondeviceorientationEnabled() { return isDeviceOrientationEnabled; } 120 116 121 private: 117 122 // Never instantiate. … … 127 132 static bool isPushStateEnabled; 128 133 static bool isTouchEnabled; 134 static bool isDeviceOrientationEnabled; 129 135 }; 130 136 -
trunk/WebCore/page/DOMWindow.cpp
r63689 r63750 1414 1414 addBeforeUnloadEventListener(this); 1415 1415 #if ENABLE(DEVICE_ORIENTATION) 1416 else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() )1417 frame()->page()->deviceOrientation ()->addListener(this);1416 else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController()) 1417 frame()->page()->deviceOrientationController()->addListener(this); 1418 1418 #endif 1419 1419 … … 1431 1431 removeBeforeUnloadEventListener(this); 1432 1432 #if ENABLE(DEVICE_ORIENTATION) 1433 else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() )1434 frame()->page()->deviceOrientation ()->removeListener(this);1433 else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController()) 1434 frame()->page()->deviceOrientationController()->removeListener(this); 1435 1435 #endif 1436 1436 … … 1509 1509 1510 1510 #if ENABLE(DEVICE_ORIENTATION) 1511 if (frame() && frame()->page() )1512 frame()->page()->deviceOrientation ()->removeAllListeners(this);1511 if (frame() && frame()->page() && frame()->page()->deviceOrientationController()) 1512 frame()->page()->deviceOrientationController()->removeAllListeners(this); 1513 1513 #endif 1514 1514 -
trunk/WebCore/page/DOMWindow.idl
r62880 r63750 305 305 attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel; 306 306 307 attribute [Conditional=DEVICE_ORIENTATION ] DeviceOrientationEventConstructor DeviceOrientationEvent;308 attribute [Conditional=DEVICE_ORIENTATION ] EventListener ondeviceorientation;307 attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent; 308 attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] EventListener ondeviceorientation; 309 309 310 310 // EventTarget interface -
trunk/WebCore/page/Page.cpp
r63230 r63750 58 58 #include "RenderTheme.h" 59 59 #include "RenderWidget.h" 60 #include "RuntimeEnabledFeatures.h" 60 61 #include "ScriptController.h" 61 62 #include "SelectionController.h" … … 140 141 #endif 141 142 #if ENABLE(DEVICE_ORIENTATION) 142 , m_deviceOrientationController( new DeviceOrientationController(this, deviceOrientationClient))143 , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, deviceOrientationClient) : 0) 143 144 #endif 144 145 #if ENABLE(INPUT_SPEECH) -
trunk/WebKit/chromium/ChangeLog
r63723 r63750 1 2010-07-20 Hans Wennborg <hans@chromium.org> 2 3 Reviewed by Steve Block. 4 5 Runtime feature switch for device orientation 6 https://bugs.webkit.org/show_bug.cgi?id=42265 7 8 Add a runtime feature switch that decides whether device orientation 9 events are available or not. Defaults to true. 10 11 * public/WebRuntimeFeatures.h: 12 * src/WebRuntimeFeatures.cpp: 13 (WebKit::WebRuntimeFeatures::enableDeviceOrientation): 14 (WebKit::WebRuntimeFeatures::isDeviceOrientationEnabled): 15 1 16 2010-07-19 Victoria Kirst <vrk@google.com> 2 17 -
trunk/WebKit/chromium/public/WebRuntimeFeatures.h
r58496 r63750 78 78 WEBKIT_API static bool isTouchEnabled(); 79 79 80 WEBKIT_API static void enableDeviceOrientation(bool); 81 WEBKIT_API static bool isDeviceOrientationEnabled(); 82 80 83 private: 81 84 WebRuntimeFeatures(); -
trunk/WebKit/chromium/src/WebRuntimeFeatures.cpp
r61388 r63750 227 227 } 228 228 229 void WebRuntimeFeatures::enableDeviceOrientation(bool enable) 230 { 231 RuntimeEnabledFeatures::setDeviceOrientationEnabled(enable); 232 } 233 234 bool WebRuntimeFeatures::isDeviceOrientationEnabled() 235 { 236 return RuntimeEnabledFeatures::deviceOrientationEnabled(); 237 } 238 229 239 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.