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
  2. 16 Mar, 2012 1 commit
    • commit-queue@webkit.org's avatar
      .: Support for Battery Status API. · 0de163f6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=62698
      
      Enable BATTERY_STATUS for WebKit-Efl.
      http://www.w3.org/TR/battery-status/
      
      Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-03-16
      Reviewed by Adam Barth.
      
      * Source/cmake/OptionsEfl.cmake:
      * Source/cmakeconfig.h.cmake:
      
      Source/WebCore: Support for Battery Status API
      https://bugs.webkit.org/show_bug.cgi?id=62698
      
      Battery Status API is implemented under the Navigator class.
      Battery Status API has four types of events, and all events are operated based on a callback mechanism.
       : onchargingchange, onchargingtimechange, ondischargingtimechange, onlevelchange.
      The battery status can be accessed using BatteryManager(navigator.webkitBattery), and battery status is controlled by BatteryController which manages instances of BatteryManager.
      When battery status event is raised, BatteryController calls all registered BatteryManager's event dispatcher.
      http://www.w3.org/TR/battery-status/
      
      Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-03-16
      Reviewed by Adam Barth.
      
      Tests: batterystatus/add-listener-from-callback.html
             batterystatus/basic-all-types-of-events.html
             batterystatus/basic-operation.html
             batterystatus/event-after-navigation.html
             batterystatus/multiple-frames.html
             batterystatus/updates.html
             batterystatus/window-property.html
      
      * CMakeLists.txt:
      * Modules/battery/BatteryClient.h: Added.
      (WebCore):
      (BatteryClient):
      (WebCore::BatteryClient::~BatteryClient):
      * Modules/battery/BatteryController.cpp: Added.
      (WebCore):
      (WebCore::BatteryController::BatteryController):
      (WebCore::BatteryController::~BatteryController):
      (WebCore::BatteryController::create):
      (WebCore::BatteryController::addListener):
      (WebCore::BatteryController::removeListener):
      (WebCore::BatteryController::didChangeBatteryStatus):
      (WebCore::BatteryController::supplementName):
      (WebCore::BatteryController::isActive):
      (WebCore::provideBatteryTo):
      * Modules/battery/BatteryController.h: Added.
      (WebCore):
      (BatteryController):
      (WebCore::BatteryController::client):
      (WebCore::BatteryController::from):
      * Modules/battery/BatteryManager.cpp: Added.
      (WebCore):
      (WebCore::BatteryManager::create):
      (WebCore::BatteryManager::~BatteryManager):
      (WebCore::BatteryManager::BatteryManager):
      (WebCore::BatteryManager::charging):
      (WebCore::BatteryManager::chargingTime):
      (WebCore::BatteryManager::dischargingTime):
      (WebCore::BatteryManager::level):
      (WebCore::BatteryManager::didChangeBatteryStatus):
      (WebCore::BatteryManager::suspend):
      (WebCore::BatteryManager::resume):
      (WebCore::BatteryManager::stop):
      * Modules/battery/BatteryManager.h: Added.
      (WebCore):
      (BatteryManager):
      (WebCore::BatteryManager::interfaceName):
      (WebCore::BatteryManager::scriptExecutionContext):
      (WebCore::BatteryManager::batteryControllerDestroyed):
      (WebCore::BatteryManager::canSuspend):
      (WebCore::BatteryManager::eventTargetData):
      (WebCore::BatteryManager::ensureEventTargetData):
      (WebCore::BatteryManager::refEventTarget):
      (WebCore::BatteryManager::derefEventTarget):
      * Modules/battery/BatteryManager.idl: Added.
      * Modules/battery/BatteryStatus.cpp: Added.
      (WebCore):
      (WebCore::BatteryStatus::create):
      (WebCore::BatteryStatus::BatteryStatus):
      * Modules/battery/BatteryStatus.h: Added.
      (WebCore):
      (BatteryStatus):
      (WebCore::BatteryStatus::charging):
      (WebCore::BatteryStatus::chargingTime):
      (WebCore::BatteryStatus::dischargingTime):
      (WebCore::BatteryStatus::level):
      * Modules/battery/NavigatorBattery.cpp: Added.
      (WebCore):
      (WebCore::NavigatorBattery::NavigatorBattery):
      (WebCore::NavigatorBattery::~NavigatorBattery):
      (WebCore::NavigatorBattery::webkitBattery):
      (WebCore::NavigatorBattery::from):
      (WebCore::NavigatorBattery::batteryManager):
      * Modules/battery/NavigatorBattery.h: Added.
      (WebCore):
      (NavigatorBattery):
      * Modules/battery/NavigatorBattery.idl: Added.
      * dom/EventNames.h:
      (WebCore):
      * dom/EventTargetFactory.in:
      * testing/Internals.cpp:
      (WebCore::Internals::setBatteryStatus):
      (WebCore):
      * testing/Internals.h:
      (Internals):
      * testing/Internals.idl:
      
      Source/WebKit: Support for Battery Status API
      https://bugs.webkit.org/show_bug.cgi?id=62698
      
      Add include directory and file.
      http://www.w3.org/TR/battery-status/
      
      Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-03-16
      Reviewed by Adam Barth.
      
      * PlatformEfl.cmake:
      
      Source/WebKit/efl: Support for Battery Status API
      https://bugs.webkit.org/show_bug.cgi?id=62698
      
      Add BatteryClientEfl class implementation for the layout tests now.
      BatteryClientEfl class is not fully implemented in this patch.
      (It will be completed by other patch as necessary in the Efl port.)
      http://www.w3.org/TR/battery-status/
      
      Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-03-16
      Reviewed by Adam Barth.
      
      * WebCoreSupport/BatteryClientEfl.cpp: Added.
      (WebCore):
      (WebCore::BatteryClientEfl::BatteryClientEfl):
      (WebCore::BatteryClientEfl::setController):
      (WebCore::BatteryClientEfl::startUpdating):
      (WebCore::BatteryClientEfl::stopUpdating):
      (WebCore::BatteryClientEfl::batteryControllerDestroyed):
      (WebCore::BatteryClientEfl::setBatteryStatus):
      * WebCoreSupport/BatteryClientEfl.h: Added.
      (WebCore):
      (BatteryClientEfl):
      (WebCore::BatteryClientEfl::~BatteryClientEfl):
      * ewk/ewk_view.cpp:
      (_Ewk_View_Private_Data):
      (_ewk_view_priv_new):
      
      Tools: Support for Battery Status API
      https://bugs.webkit.org/show_bug.cgi?id=62698
      
      Add include directory and file.
      http://www.w3.org/TR/battery-status/
      
      Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-03-16
      Reviewed by Adam Barth.
      
      * Scripts/build-webkit:
      
      LayoutTests: Support for Battery Status API.
      https://bugs.webkit.org/show_bug.cgi?id=62698
      
      Add new test cases for Battery Status API.
      http://www.w3.org/TR/battery-status/
      
      Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-03-16
      Reviewed by Adam Barth.
      
      * batterystatus/add-listener-from-callback-expected.txt: Added.
      * batterystatus/add-listener-from-callback.html: Added.
      * batterystatus/basic-all-types-of-events-expected.txt: Added.
      * batterystatus/basic-all-types-of-events.html: Added.
      * batterystatus/basic-operation-expected.txt: Added.
      * batterystatus/basic-operation.html: Added.
      * batterystatus/event-after-navigation-expected.txt: Added.
      * batterystatus/event-after-navigation.html: Added.
      * batterystatus/multiple-frames-expected.txt: Added.
      * batterystatus/multiple-frames.html: Added.
      * batterystatus/resources/event-after-navigation-new.html: Added.
      * batterystatus/script-tests/add-listener-from-callback.js: Added.
      (checkBatteryStatus):
      (firstListener):
      (secondListener):
      (maybeFinishTest):
      * batterystatus/script-tests/basic-all-types-of-events.js: Added.
      (checkBatteryStatus):
      (battery):
      * batterystatus/script-tests/basic-operation.js: Added.
      * batterystatus/script-tests/event-after-navigation.js: Added.
      * batterystatus/script-tests/multiple-frames.js: Added.
      (checkBatteryStatus):
      (checkChildBatteryStatus):
      (mainFrameListener):
      (childFrameListener):
      (maybeFinishTest):
      * batterystatus/script-tests/updates.js: Added.
      (checkBatteryStatus):
      (setBatteryStatus):
      (firstListener):
      (updateListener):
      * batterystatus/script-tests/window-property.js: Added.
      (hasOnBatteryProperty):
      * batterystatus/updates-expected.txt: Added.
      * batterystatus/updates.html: Added.
      * batterystatus/window-property-expected.txt: Added.
      * batterystatus/window-property.html: Added.
      * platform/chromium/test_expectations.txt:
      * platform/gtk/Skipped:
      * platform/qt/Skipped:
      * platform/win/Skipped:
      * platform/wincairo/Skipped:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0de163f6
  3. 14 Oct, 2010 1 commit