Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
2010-05-21 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow. Add DeviceOrientation and DeviceOrientationClient https://bugs.webkit.org/show_bug.cgi?id=39479 * src/WebViewImpl.cpp: (WebKit::WebViewImpl::WebViewImpl): 2010-05-21 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. Add DeviceOrientation and DeviceOrientationClient https://bugs.webkit.org/show_bug.cgi?id=39479 * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): 2010-05-21 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. Add DeviceOrientation and DeviceOrientationClient https://bugs.webkit.org/show_bug.cgi?id=39479 * webkit/webkitwebview.cpp: (webkit_web_view_init): 2010-05-21 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. Add DeviceOrientation and DeviceOrientationClient https://bugs.webkit.org/show_bug.cgi?id=39479 * WebView.cpp: (WebView::initWithFrame): 2010-05-21 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. Add DeviceOrientation and DeviceOrientationClient https://bugs.webkit.org/show_bug.cgi?id=39479 * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): 2010-05-21 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. Add DeviceOrientation and DeviceOrientationClient https://bugs.webkit.org/show_bug.cgi?id=39479 The page owns a DeviceOrientation object, which has a pointer to a DeviceOrientationClient object provided by the embedder. The DeviceOrientation object forwards requests to start listening to orientation to the client, and when updates are available, fires a DeviceOrientationEvent on the window object. No new tests are possible at this time as the implementation is incomplete. Future patches will add LayoutTestController methods to provide mock orientation events to test this. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * WebCore.base.exp: * WebCore.gypi: * WebCore.pro: * WebCore.vcproj/WebCore.vcproj * WebCore.xcodeproj/project.pbxproj: * dom/DeviceOrientation.cpp: Added. (WebCore::DeviceOrientation::DeviceOrientation): (WebCore::DeviceOrientation::onDeviceOrientationChange): * dom/DeviceOrientation.h: Added. * dom/DeviceOrientationClient.h: Added. (WebCore::DeviceOrientationClient::~DeviceOrientationClient): * page/Page.cpp: (WebCore::Page::Page): * page/Page.h: (WebCore::Page::deviceOrientation): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): Canonical link: https://commits.webkit.org/51028@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@59935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Steve Block
committed
May 21, 2010
1 parent
3d175a8
commit d13a40d
Showing
25 changed files
with
360 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2010, The Android Open Source Project | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER OR | ||
* 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. | ||
*/ | ||
|
||
#include "config.h" | ||
#include "DeviceOrientation.h" | ||
|
||
#if ENABLE(DEVICE_ORIENTATION) | ||
|
||
#include "DeviceOrientationClient.h" | ||
#include "DeviceOrientationEvent.h" | ||
#include <wtf/UnusedParam.h> | ||
|
||
namespace WebCore { | ||
|
||
DeviceOrientation::DeviceOrientation(Page* page, DeviceOrientationClient* client) | ||
: m_page(page) | ||
, m_client(client) | ||
{ | ||
} | ||
|
||
void DeviceOrientation::onDeviceOrientationChange(double alpha, double beta, double gamma) | ||
{ | ||
// FIXME: Fire DeviceOrientationEvents on the window object of all frames | ||
// that are listening to orientation. | ||
UNUSED_PARAM(alpha); | ||
UNUSED_PARAM(beta); | ||
UNUSED_PARAM(gamma); | ||
} | ||
|
||
} // namespace WebCore | ||
|
||
#endif // ENABLE(DEVICE_ORIENTATION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2010, The Android Open Source Project | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER OR | ||
* 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 DeviceOrientation_h | ||
#define DeviceOrientation_h | ||
|
||
namespace WebCore { | ||
|
||
class DeviceOrientationClient; | ||
class Page; | ||
|
||
class DeviceOrientation { | ||
public: | ||
DeviceOrientation(Page*, DeviceOrientationClient*); | ||
|
||
// FIXME: Add methods to start and stop the service. | ||
|
||
void onDeviceOrientationChange(double alpha, double beta, double gamma); | ||
|
||
private: | ||
Page* m_page; | ||
DeviceOrientationClient* m_client; | ||
}; | ||
|
||
} // namespace WebCore | ||
|
||
#endif // DeviceOrientation_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2010, The Android Open Source Project | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER OR | ||
* 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 DeviceOrientationClient_h | ||
#define DeviceOrientationClient_h | ||
|
||
namespace WebCore { | ||
|
||
class DeviceOrientationClient { | ||
public: | ||
virtual void startUpdating() = 0; | ||
virtual void stopUpdating() = 0; | ||
|
||
protected: | ||
virtual ~DeviceOrientationClient() {} | ||
}; | ||
|
||
} // namespace WebCore | ||
|
||
#endif // DeviceOrientationClient_h |
Oops, something went wrong.