Add DeviceProximityController to support Device Proximity Events.

https://bugs.webkit.org/show_bug.cgi?id=97630

Reviewed by Hajime Morita.

Source/WebCore:

Implement DeviceProximityController which is inherited from DeviceController to support Device Proximity Events.
DeviceProximityController has two major functionalities.
- When listener is added, DeviceProximityController stores DOMWindow pointer to m_listeners
  and start gathering proximity event.
- When DeviceProximityController receives a proximity event from client, fire an event using m_listeners.
In addition, setDeviceProximity function is added to Internals for layout test.

Tests: proximity/add-listener-from-callback.html
       proximity/basic-operation.html
       proximity/create-event.html
       proximity/event-after-navigation.html
       proximity/multiple-frames.html
       proximity/no-page-cache.html
       proximity/optional-event-properties.html
       proximity/updates.html
       proximity/window-property.html

* CMakeLists.txt:
* GNUmakefile.am:
* GNUmakefile.list.am:
* Modules/proximity/DeviceProximityClient.h: Added.
(WebCore):
(DeviceProximityClient):
(WebCore::DeviceProximityClient::~DeviceProximityClient):
* Modules/proximity/DeviceProximityController.cpp: Added.
(WebCore):
(WebCore::DeviceProximityController::DeviceProximityController):
(WebCore::DeviceProximityController::create):
(WebCore::DeviceProximityController::didChangeDeviceProximity):
(WebCore::DeviceProximityController::deviceProximityClient):
(WebCore::DeviceProximityController::hasLastData):
(WebCore::DeviceProximityController::getLastEvent):
(WebCore::DeviceProximityController::supplementName):
(WebCore::DeviceProximityController::from):
(WebCore::DeviceProximityController::isActiveAt):
(WebCore::provideDeviceProximityTo):
* Modules/proximity/DeviceProximityController.h: Added.
(WebCore):
(DeviceProximityController):
(WebCore::DeviceProximityController::~DeviceProximityController):
* Target.pri:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* WebCore.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcproj/WebCoreCommon.vsprops:
* WebCore.xcodeproj/project.pbxproj:
* history/PageCache.cpp:
When a page has Device Proximity Event Listener, it has not to be cached like Device Orientation.
(WebCore::logCanCachePageDecision):
(WebCore::PageCache::canCache):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* testing/Internals.cpp:
(WebCore::Internals::setDeviceProximity):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Source/WebKit2:

Add initial WebDeviceProximityClient class which is inherited DeviceProximityClient.
But startUpdating and stopUpdating need to be implemented.

* CMakeLists.txt:
* WebProcess/WebCoreSupport/WebDeviceProximityClient.cpp: Added.
(WebKit):
(WebKit::WebDeviceProximityClient::WebDeviceProximityClient):
(WebKit::WebDeviceProximityClient::startUpdating):
(WebKit::WebDeviceProximityClient::stopUpdating):
(WebKit::WebDeviceProximityClient::hasLastData):
* WebProcess/WebCoreSupport/WebDeviceProximityClient.h: Added.
(WebKit):
(WebDeviceProximityClient):
(WebKit::WebDeviceProximityClient::~WebDeviceProximityClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):

LayoutTests:

Add layout test cases for the DeviceProximityController.

* proximity/add-listener-from-callback-expected.txt: Added.
* proximity/add-listener-from-callback.html: Added.
* proximity/basic-operation-expected.txt: Added.
* proximity/basic-operation.html: Added.
* proximity/create-event-expected.txt: Added.
* proximity/create-event.html: Added.
* proximity/event-after-navigation-expected.txt: Added.
* proximity/event-after-navigation.html: Added.
* proximity/multiple-frames-expected.txt: Added.
* proximity/multiple-frames.html: Added.
* proximity/no-page-cache-expected.txt: Added.
* proximity/no-page-cache.html: Added.
* proximity/optional-event-properties-expected.txt: Added.
* proximity/optional-event-properties.html: Added.
* proximity/resources/cached-page-1.html: Added.
* proximity/resources/cached-page-2.html: Added.
* proximity/resources/event-after-navigation-new.html: Added.
* proximity/updates-expected.txt: Added.
* proximity/updates.html: Added.
* proximity/window-property-expected.txt: Added.
* proximity/window-property.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 916c17bc
2013-01-08 Kihong Kwon <kihong.kwon@samsung.com>
Add DeviceProximityController to support Device Proximity Events.
https://bugs.webkit.org/show_bug.cgi?id=97630
Reviewed by Hajime Morita.
Add layout test cases for the DeviceProximityController.
* proximity/add-listener-from-callback-expected.txt: Added.
* proximity/add-listener-from-callback.html: Added.
* proximity/basic-operation-expected.txt: Added.
* proximity/basic-operation.html: Added.
* proximity/create-event-expected.txt: Added.
* proximity/create-event.html: Added.
* proximity/event-after-navigation-expected.txt: Added.
* proximity/event-after-navigation.html: Added.
* proximity/multiple-frames-expected.txt: Added.
* proximity/multiple-frames.html: Added.
* proximity/no-page-cache-expected.txt: Added.
* proximity/no-page-cache.html: Added.
* proximity/optional-event-properties-expected.txt: Added.
* proximity/optional-event-properties.html: Added.
* proximity/resources/cached-page-1.html: Added.
* proximity/resources/cached-page-2.html: Added.
* proximity/resources/event-after-navigation-new.html: Added.
* proximity/updates-expected.txt: Added.
* proximity/updates.html: Added.
* proximity/window-property-expected.txt: Added.
* proximity/window-property.html: Added.
2013-01-08 Zan Dobersek <zandobersek@gmail.com>
Unreviewed GTK gardening.
Tests that adding a new event listener from a callback works as expected.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS deviceProximityEvent.value is firedEvent.value
PASS deviceProximityEvent.min is firedEvent.min
PASS deviceProximityEvent.max is firedEvent.max
PASS deviceProximityEvent.value is firedEvent.value
PASS deviceProximityEvent.min is firedEvent.min
PASS deviceProximityEvent.max is firedEvent.max
PASS deviceProximityEvent.value is firedEvent.value
PASS deviceProximityEvent.min is firedEvent.min
PASS deviceProximityEvent.max is firedEvent.max
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests that adding a new event listener from a callback works as expected.');
var firedEvent = {value: 2.2, min: 1.1, max: 3.3};
var deviceProximityEvent;
function checkProximity(event) {
deviceProximityEvent = event;
shouldBe('deviceProximityEvent.value', 'firedEvent.value');
shouldBe('deviceProximityEvent.min', 'firedEvent.min');
shouldBe('deviceProximityEvent.max', 'firedEvent.max');
}
var firstListenerEvents = 0;
function firstListener(event) {
checkProximity(event);
if (++firstListenerEvents == 1) {
window.addEventListener('webkitdeviceproximity', secondListener);
internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max);
}
else if (firstListenerEvents > 2)
testFailed('Too many events for first listener.');
maybeFinishTest();
}
var secondListenerEvents = 0;
function secondListener(event) {
checkProximity(event);
if (++secondListenerEvents > 1)
testFailed('Too many events for second listener.');
maybeFinishTest();
}
function maybeFinishTest() {
if (firstListenerEvents == 2 && secondListenerEvents == 1)
finishJSTest();
}
window.addEventListener('webkitdeviceproximity', firstListener);
internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max);
window.jsTestIsAsync = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests the basic operation of DeviceProximity using the proximity.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS deviceProximityEvent.value is firedEvent.value
PASS deviceProximityEvent.min is firedEvent.max
PASS deviceProximityEvent.max is firedEvent.min
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests the basic operation of DeviceProximity using the proximity.');
var firedEvent = {value: 2.2, min: 1.1, max: 3.3};
var deviceProximityEvent;
window.addEventListener('webkitdeviceproximity', function(e) {
deviceProximityEvent = e;
shouldBe('deviceProximityEvent.value', 'firedEvent.value');
shouldBe('deviceProximityEvent.min', 'firedEvent.max');
shouldBe('deviceProximityEvent.max', 'firedEvent.min');
finishJSTest();
});
internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.max, firedEvent.min);
window.jsTestIsAsync = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests that document.createEvent() works with DeviceProximityEvent.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS typeof event == 'object' is true
PASS 'type' in event is true
PASS 'bubbles' in event is true
PASS 'cancelable' in event is true
PASS 'value' in event is true
PASS 'min' in event is true
PASS 'max' in event is true
PASS typeof event.type == 'string' is true
PASS typeof event.bubbles == 'boolean' is true
PASS typeof event.cancelable == 'boolean' is true
PASS typeof event.value == 'number' is true
PASS typeof event.min == 'number' is true
PASS typeof event.max == 'number' is true
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests that document.createEvent() works with DeviceProximityEvent.');
var event = document.createEvent('DeviceProximityEvent');
shouldBeTrue("typeof event == 'object'");
shouldBeTrue("'type' in event");
shouldBeTrue("'bubbles' in event");
shouldBeTrue("'cancelable' in event");
shouldBeTrue("'value' in event");
shouldBeTrue("'min' in event");
shouldBeTrue("'max' in event");
shouldBeTrue("typeof event.type == 'string'");
shouldBeTrue("typeof event.bubbles == 'boolean'");
shouldBeTrue("typeof event.cancelable == 'boolean'");
shouldBeTrue("typeof event.value == 'number'");
shouldBeTrue("typeof event.min == 'number'");
shouldBeTrue("typeof event.max == 'number'");
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests for a crash where an event is fired after the page has been navigated away when the original page is in the page cache.
SUCCESS
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests for a crash where an event is fired after the page has been navigated away when the original page is in the page cache.');
if (window.testRunner)
testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
else
debug('This test can not be run without the TestRunner');
document.body.onload = function() {
window.addEventListener('webkitdeviceproximity', function() { } );
window.location = "resources/event-after-navigation-new.html";
}
window.jsTestIsAsync = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests using DeviceProximity from multiple frames.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS DeviceProximityEvent.value is firedEvent.value
PASS DeviceProximityEvent.min is firedEvent.min
PASS DeviceProximityEvent.max is firedEvent.max
PASS DeviceProximityEvent.value is firedEvent.value
PASS DeviceProximityEvent.min is firedEvent.min
PASS DeviceProximityEvent.max is firedEvent.max
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests using DeviceProximity from multiple frames.');
var DeviceProximityEvent;
function checkProximity(event) {
DeviceProximityEvent = event;
shouldBe('DeviceProximityEvent.value', 'firedEvent.value');
shouldBe('DeviceProximityEvent.min', 'firedEvent.min');
shouldBe('DeviceProximityEvent.max', 'firedEvent.max');
}
var hasMainFrameEventFired = false;
function mainFrameListener(event) {
checkProximity(event);
hasMainFrameEventFired = true;
maybeFinishTest();
}
var hasChildFrameEventFired = false;
function childFrameListener(event) {
checkProximity(event);
hasChildFrameEventFired = true;
maybeFinishTest();
}
function maybeFinishTest() {
if (hasMainFrameEventFired && hasChildFrameEventFired)
finishJSTest();
}
var childFrame = document.createElement('iframe');
document.body.appendChild(childFrame);
childFrame.contentWindow.addEventListener('webkitdeviceproximity', childFrameListener);
window.addEventListener('webkitdeviceproximity', mainFrameListener);
var firedEvent = {value: 2.2, min: 1.1, max: 3.3};
internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max);
window.jsTestIsAsync = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests that pages that use DeviceProximity are not put in the page cache.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Main page opening resources/cached-page-1.html
resources/cached-page-1.html onload fired, count = 1
resources/cached-page-1.html about to navigate to resources/cached-page-2.html
resources/cached-page-2.html about to go back to resources/cached-page-1.html
resources/cached-page-1.html onload fired, count = 2
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests that pages that use DeviceProximity are not put in the page cache.');
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
} else
debug('This test can not be run without the TestRunner');
var pageOneOnloadCount = 0;
function reportPageOneOnload() {
++pageOneOnloadCount;
debug('resources/cached-page-1.html onload fired, count = ' + pageOneOnloadCount);
if (pageOneOnloadCount == 2) {
finishJSTest();
}
return pageOneOnloadCount;
}
debug("Main page opening resources/cached-page-1.html");
window.open("resources/cached-page-1.html");
window.jsTestIsAsync = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests the optional properties of DeviceProximityEvent. Each property should be null if not set, or set to null or undefined.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
event = document.createEvent('DeviceProximityEvent')
PASS event.value == Number.POSITIVE_INFINITY is true
PASS event.min == Number.NEGATIVE_INFINITY is true
PASS event.max == Number.POSITIVE_INFINITY is true
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests the optional properties of DeviceProximityEvent. Each property should be null if not set, or set to null or undefined.');
var event;
evalAndLog("event = document.createEvent('DeviceProximityEvent')");
shouldBeTrue("event.value == Number.POSITIVE_INFINITY");
shouldBeTrue("event.min == Number.NEGATIVE_INFINITY");
shouldBeTrue("event.max == Number.POSITIVE_INFINITY");
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
<script>
function loadNext() {
window.addEventListener('webkitdeviceproximity', function() {});
if (window.opener.reportPageOneOnload() == 1) {
window.opener.debug('resources/cached-page-1.html about to navigate to resources/cached-page-2.html')
// Location changes need to happen outside the onload handler to generate history entries.
setTimeout(function() { location.href = 'cached-page-2.html'; }, 0);
}
}
</script>
<body onload="loadNext()"></body>
\ No newline at end of file
<script>
function init() {
window.opener.pageTwoLoaded = true;
window.opener.debug('resources/cached-page-2.html about to go back to resources/cached-page-1.html');
history.back();
}
</script>
<body onload="init()"></body>
\ No newline at end of file
<html>
<head>
</head>
<body>
Tests for a crash where an event is fired after the page has been navigated
away when the original page is in the page cache.<br><br>
SUCCESS
<script>
if (window.testRunner) {
internals.setDeviceProximity(document, 'webkitdeviceproximity', 1.1, 2.2, 3.3);
testRunner.notifyDone();
}
</script>
</body>
</html>
\ No newline at end of file
Tests that updates to the proximity causes new events to fire.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS deviceProximityEvent.value is firedEvent.value
PASS deviceProximityEvent.min is firedEvent.min
PASS deviceProximityEvent.max is firedEvent.max
PASS deviceProximityEvent.value is firedEvent.value
PASS deviceProximityEvent.min is firedEvent.min
PASS deviceProximityEvent.max is firedEvent.max
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests that updates to the proximity causes new events to fire.');
var firedEvent;
function setProximity(value, min, max) {
firedEvent = {value: value, min: min, max: max};
internals.setDeviceProximity(document, 'webkitdeviceproximity', firedEvent.value, firedEvent.min, firedEvent.max);
}
var deviceProximityEvent;
function checkProximity(event) {
deviceProximityEvent = event;
shouldBe('deviceProximityEvent.value', 'firedEvent.value');
shouldBe('deviceProximityEvent.min', 'firedEvent.min');
shouldBe('deviceProximityEvent.max', 'firedEvent.max');
}
function firstListener(event) {
checkProximity(event);
window.removeEventListener('webkitdeviceproximity', firstListener);
window.addEventListener('webkitdeviceproximity', updateListener);
setProximity(22.2, 11.1, 33.3);
}
function updateListener(event) {
checkProximity(event);
finishJSTest();
}
window.addEventListener('webkitdeviceproximity', firstListener);
setProximity(2.2, 1.1, 3.3);
window.jsTestIsAsync = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
Tests that the window.DeviceProximityEvent and window.onwebkitdeviceproximity properties are present.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS typeof window.DeviceProximityEvent == 'object' is true
PASS typeof window.DeviceProximityEvent == 'function' is false
PASS hasDeviceProximityEventProperty() is true
PASS 'DeviceProximityEvent' in window is true
PASS window.hasOwnProperty('DeviceProximityEvent') is true
PASS typeof window.onwebkitdeviceproximity == 'object' is true
PASS hasOnDeviceProximityProperty() is true
PASS 'onwebkitdeviceproximity' in window is true
PASS window.hasOwnProperty('onwebkitdeviceproximity') is true
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Tests that the window.DeviceProximityEvent and window.onwebkitdeviceproximity properties are present.');
function hasDeviceProximityEventProperty()
{
for (var property in window) {
if (property == 'DeviceProximityEvent')
return true;
}
return false;
}
shouldBeTrue("typeof window.DeviceProximityEvent == 'object'");
shouldBeFalse("typeof window.DeviceProximityEvent == 'function'");
shouldBeTrue("hasDeviceProximityEventProperty()");
shouldBeTrue("'DeviceProximityEvent' in window");
shouldBeTrue("window.hasOwnProperty('DeviceProximityEvent')");
function hasOnDeviceProximityProperty()
{
for (var property in window) {
if (property == 'onwebkitdeviceproximity')
return true;
}
return false;
}
shouldBeTrue("typeof window.onwebkitdeviceproximity == 'object'");
shouldBeTrue("hasOnDeviceProximityProperty()");
shouldBeTrue("'onwebkitdeviceproximity' in window");
shouldBeTrue("window.hasOwnProperty('onwebkitdeviceproximity')");
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
......@@ -118,6 +118,7 @@ set(WebCore_IDL_INCLUDES
Modules/mediastream
Modules/networkinfo
Modules/notifications
Modules/proximity
Modules/quota
Modules/speech
Modules/vibration
......@@ -890,6 +891,7 @@ set(WebCore_SOURCES
Modules/notifications/Notification.cpp
Modules/notifications/WorkerContextNotifications.cpp
Modules/proximity/DeviceProximityController.cpp
Modules/proximity/DeviceProximityEvent.cpp
Modules/quota/DOMWindowQuota.cpp
......
2013-01-08 Kihong Kwon <kihong.kwon@samsung.com>
Add DeviceProximityController to support Device Proximity Events.
https://bugs.webkit.org/show_bug.cgi?id=97630
Reviewed by Hajime Morita.
Implement DeviceProximityController which is inherited from DeviceController to support Device Proximity Events.
DeviceProximityController has two major functionalities.
- When listener is added, DeviceProximityController stores DOMWindow pointer to m_listeners
and start gathering proximity event.
- When DeviceProximityController receives a proximity event from client, fire an event using m_listeners.
In addition, setDeviceProximity function is added to Internals for layout test.
Tests: proximity/add-listener-from-callback.html
proximity/basic-operation.html
proximity/create-event.html
proximity/event-after-navigation.html
proximity/multiple-frames.html
proximity/no-page-cache.html
proximity/optional-event-properties.html
proximity/updates.html
proximity/window-property.html
* CMakeLists.txt:
* GNUmakefile.am:
* GNUmakefile.list.am:
* Modules/proximity/DeviceProximityClient.h: Added.
(WebCore):
(DeviceProximityClient):
(WebCore::DeviceProximityClient::~DeviceProximityClient):
* Modules/proximity/DeviceProximityController.cpp: Added.
(WebCore):
(WebCore::DeviceProximityController::DeviceProximityController):
(WebCore::DeviceProximityController::create):
(WebCore::DeviceProximityController::didChangeDeviceProximity):
(WebCore::DeviceProximityController::deviceProximityClient):
(WebCore::DeviceProximityController::hasLastData):
(WebCore::DeviceProximityController::getLastEvent):
(WebCore::DeviceProximityController::supplementName):
(WebCore::DeviceProximityController::from):
(WebCore::DeviceProximityController::isActiveAt):
(WebCore::provideDeviceProximityTo):
* Modules/proximity/DeviceProximityController.h: Added.
(WebCore):
(DeviceProximityController):
(WebCore::DeviceProximityController::~DeviceProximityController):
* Target.pri:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* WebCore.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcproj/WebCoreCommon.vsprops:
* WebCore.xcodeproj/project.pbxproj:
* history/PageCache.cpp:
When a page has Device Proximity Event Listener, it has not to be cached like Device Orientation.
(WebCore::logCanCachePageDecision):
(WebCore::PageCache::canCache):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* testing/Internals.cpp:
(WebCore::Internals::setDeviceProximity):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:
2013-01-03 Sergio Villar Senin <svillar@igalia.com>
[GTK] Add WebP image support
......@@ -20,6 +20,7 @@ webcore_cppflags += \
-I$(srcdir)/Source/WebCore/Modules/mediastream \
-I$(srcdir)/Source/WebCore/Modules/navigatorcontentutils \
-I$(srcdir)/Source/WebCore/Modules/notifications \
-I$(srcdir)/Source/WebCore/Modules/proximity \
-I$(srcdir)/Source/WebCore/Modules/quota \
-I$(srcdir)/Source/WebCore/Modules/webaudio \
-I$(srcdir)/Source/WebCore/Modules/webdatabase \
......@@ -502,6 +503,7 @@ IDL_PATH := \
$(WebCore)/Modules/mediasource \
$(WebCore)/Modules/mediastream \
$(WebCore)/Modules/notifications \
$(WebCore)/Modules/proximity \
$(WebCore)/Modules/quota \
$(WebCore)/Modules/webaudio \
$(WebCore)/Modules/webdatabase \
......@@ -737,6 +739,7 @@ EXTRA_DIST += \
$(wildcard $(srcdir)/Source/WebCore/Modules/mediastream/*.idl) \
$(wildcard $(srcdir)/Source/WebCore/Modules/navigatorcontentutils/*.idl) \
$(wildcard $(srcdir)/Source/WebCore/Modules/notifications/*.idl) \
$(wildcard $(srcdir)/Source/WebCore/Modules/proximity/*.idl) \
$(wildcard $(srcdir)/Source/WebCore/Modules/quota/*.idl) \
$(wildcard $(srcdir)/Source/WebCore/Modules/webaudio/*.idl) \
$(wildcard $(srcdir)/Source/WebCore/Modules/webdatabase/*.idl) \
......
......@@ -1262,6 +1262,7 @@ dom_binding_idls += \
$(WebCore)/Modules/notifications/Notification.idl \
$(WebCore)/Modules/notifications/NotificationCenter.idl \
$(WebCore)/Modules/notifications/NotificationPermissionCallback.idl \
$(WebCore)/Modules/proximity/DeviceProximityEvent.idl \
$(WebCore)/Modules/quota/DOMWindowQuota.idl \
$(WebCore)/Modules/quota/StorageInfo.idl \
$(WebCore)/Modules/quota/StorageInfoErrorCallback.idl \
......@@ -1991,6 +1992,11 @@ webcore_modules_sources += \
Source/WebCore/Modules/notifications/NotificationPermissionCallback.h \
Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp \
Source/WebCore/Modules/notifications/WorkerContextNotifications.h \
Source/WebCore/Modules/proximity/DeviceProximity.h \
Source/WebCore/Modules/proximity/DeviceProximityController.cpp \
Source/WebCore/Modules/proximity/DeviceProximityController.h \
Source/WebCore/Modules/proximity/DeviceProximityEvent.cpp \
Source/WebCore/Modules/proximity/DeviceProximityEvent.h \
Source/WebCore/Modules/quota/DOMWindowQuota.cpp \
Source/WebCore/Modules/quota/DOMWindowQuota.h \
Source/WebCore/Modules/quota/StorageInfo.cpp \
......
/*
* Copyright 2012 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DeviceProximityClient_h
#define DeviceProximityClient_h
#if ENABLE(PROXIMITY_EVENTS)
#include "DeviceClient.h"
#include <limits>
namespace WebCore {
class Page;
class DeviceProximityClient : public DeviceClient {
public:
virtual ~DeviceProximityClient() { }
virtual bool hasLastData() = 0;
virtual double value() = 0;
virtual double min() = 0;