1. 08 Jan, 2013 1 commit
    • kihong.kwon@samsung.com's avatar
      Add DeviceProximityController to support Device Proximity Events. · 7d642a29
      kihong.kwon@samsung.com authored
      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
      7d642a29