[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
steveblock at google.com
steveblock at google.com
Wed Dec 22 12:57:13 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7ff58d47933d202bc81b103c2592d9647528a1bc
Author: steveblock at google.com <steveblock at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 2 21:22:57 2010 +0000
2010-09-02 Steve Block <steveblock at google.com>
Reviewed by Adam Barth.
Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
https://bugs.webkit.org/show_bug.cgi?id=43181
* WebKit.xcodeproj/project.pbxproj:
2010-09-02 Steve Block <steveblock at google.com>
Reviewed by Adam Barth.
Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
https://bugs.webkit.org/show_bug.cgi?id=43181
This patch hooks up the mock device orientation client on Mac for use
in DumpRenderTree.
The patch adds a new WebDeviceOrientationClient for Mac. This client acts
as a proxy to either a real or mock device orientation provider, both of
which implement a new WebDeviceOrientationProvider interface.
The provider is created by the embedder and passed to the WebView, from
where WebDeviceOrientationClient can access it.
The mock provider, WebDeviceOrientationProviderMock, is a wrapper around
the existing WebCore mock.
* WebCoreSupport/WebDeviceOrientationClient.h: Added.
* WebCoreSupport/WebDeviceOrientationClient.mm: Added.
(WebDeviceOrientationClient::WebDeviceOrientationClient):
(WebDeviceOrientationClient::setController):
(WebDeviceOrientationClient::startUpdating):
(WebDeviceOrientationClient::stopUpdating):
(WebDeviceOrientationClient::lastOrientation):
* WebKit.exp:
* WebView/WebDeviceOrientation.h: Added.
* WebView/WebDeviceOrientation.mm: Added.
(-[WebDeviceOrientation initWithCoreDeviceOrientation:WebCore::]):
(core):
(-[WebDeviceOrientation initWithCanProvideAlpha:alpha:canProvideBeta:beta:canProvideGamma:gamma:]):
(-[WebDeviceOrientation dealloc]):
* WebView/WebDeviceOrientationInternal.h: Added.
* WebView/WebDeviceOrientationProvider.h: Added.
* WebView/WebDeviceOrientationProviderMock.h: Added.
* WebView/WebDeviceOrientationProviderMock.mm: Added.
(-[WebDeviceOrientationProviderMockInternal setOrientation:]):
(-[WebDeviceOrientationProviderMockInternal setController:]):
(-[WebDeviceOrientationProviderMockInternal startUpdating]):
(-[WebDeviceOrientationProviderMockInternal stopUpdating]):
(-[WebDeviceOrientationProviderMockInternal lastOrientation]):
(-[WebDeviceOrientationProviderMock init]):
(-[WebDeviceOrientationProviderMock dealloc]):
(-[WebDeviceOrientationProviderMock setOrientation:]):
(-[WebDeviceOrientationProviderMock setController:]):
(-[WebDeviceOrientationProviderMock startUpdating]):
(-[WebDeviceOrientationProviderMock stopUpdating]):
(-[WebDeviceOrientationProviderMock lastOrientation]):
* WebView/WebDeviceOrientationProviderMockInternal.h: Added.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
(-[WebView _setDeviceOrientationProvider:]):
(-[WebView _deviceOrientationProvider]):
* WebView/WebViewData.h:
* WebView/WebViewPrivate.h:
2010-09-02 Steve Block <steveblock at google.com>
Reviewed by Adam Barth.
Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
https://bugs.webkit.org/show_bug.cgi?id=43181
* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::setMockDeviceOrientation):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 898fc8d..bdddda0 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-02 Steve Block <steveblock at google.com>
+
+ Reviewed by Adam Barth.
+
+ Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
+ https://bugs.webkit.org/show_bug.cgi?id=43181
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2010-08-30 Andy Estes <aestes at apple.com>
Reviewed by Darin Adler.
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index b76bd24..5b44054 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -111,6 +111,15 @@
51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
5241ADF50B1BC48A004012BD /* WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5241ADF30B1BC48A004012BD /* WebCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5241ADF40B1BC48A004012BD /* WebCache.mm */; };
+ 598AD91A1201CEC900ABAE4E /* WebDeviceOrientationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9191201CEC900ABAE4E /* WebDeviceOrientationClient.h */; };
+ 598AD91E1201CECF00ABAE4E /* WebDeviceOrientationClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598AD91D1201CECF00ABAE4E /* WebDeviceOrientationClient.mm */; };
+ 598AD9201201CF0700ABAE4E /* WebDeviceOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 598AD9221201CF1000ABAE4E /* WebDeviceOrientation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */; };
+ 598AD9241201CF1900ABAE4E /* WebDeviceOrientationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */; };
+ 598AD9261201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9251201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */; };
+ 598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */; };
+ 598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; };
5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */; };
@@ -523,6 +532,15 @@
51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItemPrivate.h; sourceTree = "<group>"; };
5241ADF30B1BC48A004012BD /* WebCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCache.h; sourceTree = "<group>"; };
5241ADF40B1BC48A004012BD /* WebCache.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCache.mm; sourceTree = "<group>"; };
+ 598AD9191201CEC900ABAE4E /* WebDeviceOrientationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationClient.h; sourceTree = "<group>"; };
+ 598AD91D1201CECF00ABAE4E /* WebDeviceOrientationClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDeviceOrientationClient.mm; sourceTree = "<group>"; };
+ 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientation.h; sourceTree = "<group>"; };
+ 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDeviceOrientation.mm; sourceTree = "<group>"; };
+ 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationInternal.h; sourceTree = "<group>"; };
+ 598AD9251201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProviderMock.h; sourceTree = "<group>"; };
+ 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDeviceOrientationProviderMock.mm; sourceTree = "<group>"; };
+ 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProviderMockInternal.h; sourceTree = "<group>"; };
+ 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProvider.h; sourceTree = "<group>"; };
5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; };
5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; };
5DE83A750D0F7F9400CAD12A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/WebJavaScriptTextInputPanel.nib; sourceTree = SOURCE_ROOT; };
@@ -1124,6 +1142,13 @@
9C7CABBB0190A37C0ECA16EA /* WebView */ = {
isa = PBXGroup;
children = (
+ 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */,
+ 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */,
+ 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */,
+ 598AD9251201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h */,
+ 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */,
+ 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */,
+ 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */,
F52CA6BD02DF9D0F018635CA /* HTML */,
51E94C0706C02CA300A9B09E /* PDF */,
8373435A0624EE0D00F3B289 /* WebArchive.h */,
@@ -1249,6 +1274,8 @@
F5B36B400281DE87018635CB /* WebCoreSupport */ = {
isa = PBXGroup;
children = (
+ 598AD91D1201CECF00ABAE4E /* WebDeviceOrientationClient.mm */,
+ 598AD9191201CEC900ABAE4E /* WebDeviceOrientationClient.h */,
B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */,
B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */,
A5DEFC1111D5344B00885273 /* WebApplicationCacheQuotaManager.h */,
@@ -1589,6 +1616,12 @@
A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */,
B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */,
9391F275121B38BD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
+ 598AD91A1201CEC900ABAE4E /* WebDeviceOrientationClient.h in Headers */,
+ 598AD9201201CF0700ABAE4E /* WebDeviceOrientation.h in Headers */,
+ 598AD9241201CF1900ABAE4E /* WebDeviceOrientationInternal.h in Headers */,
+ 598AD9261201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h in Headers */,
+ 598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */,
+ 598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1952,6 +1985,9 @@
A5DEFC1411D5344B00885273 /* WebApplicationCacheQuotaManager.mm in Sources */,
B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */,
9391F276121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,
+ 598AD91E1201CECF00ABAE4E /* WebDeviceOrientationClient.mm in Sources */,
+ 598AD9221201CF1000ABAE4E /* WebDeviceOrientation.mm in Sources */,
+ 598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 88a2fbf..dc7e982 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,61 @@
+2010-09-02 Steve Block <steveblock at google.com>
+
+ Reviewed by Adam Barth.
+
+ Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
+ https://bugs.webkit.org/show_bug.cgi?id=43181
+
+ This patch hooks up the mock device orientation client on Mac for use
+ in DumpRenderTree.
+
+ The patch adds a new WebDeviceOrientationClient for Mac. This client acts
+ as a proxy to either a real or mock device orientation provider, both of
+ which implement a new WebDeviceOrientationProvider interface.
+
+ The provider is created by the embedder and passed to the WebView, from
+ where WebDeviceOrientationClient can access it.
+
+ The mock provider, WebDeviceOrientationProviderMock, is a wrapper around
+ the existing WebCore mock.
+
+ * WebCoreSupport/WebDeviceOrientationClient.h: Added.
+ * WebCoreSupport/WebDeviceOrientationClient.mm: Added.
+ (WebDeviceOrientationClient::WebDeviceOrientationClient):
+ (WebDeviceOrientationClient::setController):
+ (WebDeviceOrientationClient::startUpdating):
+ (WebDeviceOrientationClient::stopUpdating):
+ (WebDeviceOrientationClient::lastOrientation):
+ * WebKit.exp:
+ * WebView/WebDeviceOrientation.h: Added.
+ * WebView/WebDeviceOrientation.mm: Added.
+ (-[WebDeviceOrientation initWithCoreDeviceOrientation:WebCore::]):
+ (core):
+ (-[WebDeviceOrientation initWithCanProvideAlpha:alpha:canProvideBeta:beta:canProvideGamma:gamma:]):
+ (-[WebDeviceOrientation dealloc]):
+ * WebView/WebDeviceOrientationInternal.h: Added.
+ * WebView/WebDeviceOrientationProvider.h: Added.
+ * WebView/WebDeviceOrientationProviderMock.h: Added.
+ * WebView/WebDeviceOrientationProviderMock.mm: Added.
+ (-[WebDeviceOrientationProviderMockInternal setOrientation:]):
+ (-[WebDeviceOrientationProviderMockInternal setController:]):
+ (-[WebDeviceOrientationProviderMockInternal startUpdating]):
+ (-[WebDeviceOrientationProviderMockInternal stopUpdating]):
+ (-[WebDeviceOrientationProviderMockInternal lastOrientation]):
+ (-[WebDeviceOrientationProviderMock init]):
+ (-[WebDeviceOrientationProviderMock dealloc]):
+ (-[WebDeviceOrientationProviderMock setOrientation:]):
+ (-[WebDeviceOrientationProviderMock setController:]):
+ (-[WebDeviceOrientationProviderMock startUpdating]):
+ (-[WebDeviceOrientationProviderMock stopUpdating]):
+ (-[WebDeviceOrientationProviderMock lastOrientation]):
+ * WebView/WebDeviceOrientationProviderMockInternal.h: Added.
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+ (-[WebView _setDeviceOrientationProvider:]):
+ (-[WebView _deviceOrientationProvider]):
+ * WebView/WebViewData.h:
+ * WebView/WebViewPrivate.h:
+
2010-09-01 Jia Pu <jpu at apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
new file mode 100644
index 0000000..1cbc8e2
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientationProvider.h"
+#import <WebCore/DeviceOrientationClient.h>
+
+namespace WebCore {
+class DeviceOrientationController;
+}
+
+ at class WebView;
+
+// This class is the Mac implementation of DeviceOrientationClient. It is
+// passed to the Page constructor by the WebView. It is a simple proxy to
+// either the real or mock client which is passed to the WebView. It is
+// required because the WebView must pass a client to the Page constructor,
+// but the real or mock client can not be specified until after the Page has
+// been constructed.
+class WebDeviceOrientationClient : public WebCore::DeviceOrientationClient {
+public:
+ WebDeviceOrientationClient(WebView*);
+
+ // DeviceOrientationClient methods
+ virtual void setController(WebCore::DeviceOrientationController*);
+ virtual void startUpdating();
+ virtual void stopUpdating();
+ virtual WebCore::DeviceOrientation* lastOrientation() const;
+
+private:
+ id<WebDeviceOrientationProvider> getProvider() const;
+
+ WebView* m_webView;
+ WebCore::DeviceOrientationController* m_controller;
+ mutable id<WebDeviceOrientationProvider> m_provider;
+};
diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
new file mode 100644
index 0000000..278e835
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientationClient.h"
+
+#import "WebDeviceOrientationInternal.h"
+#import "WebDeviceOrientationProvider.h"
+#import "WebViewInternal.h"
+#import <objc/objc-runtime.h>
+
+using namespace WebCore;
+
+WebDeviceOrientationClient::WebDeviceOrientationClient(WebView* webView)
+ : m_webView(webView)
+ , m_controller(0)
+{
+}
+
+void WebDeviceOrientationClient::setController(DeviceOrientationController* controller)
+{
+ // This is called by the Page constructor before our WebView has the provider set up.
+ // Cache the controller for later use.
+ m_controller = controller;
+}
+
+void WebDeviceOrientationClient::startUpdating()
+{
+ [getProvider() startUpdating];
+}
+
+void WebDeviceOrientationClient::stopUpdating()
+{
+ [getProvider() stopUpdating];
+}
+
+DeviceOrientation* WebDeviceOrientationClient::lastOrientation() const
+{
+ return core([getProvider() lastOrientation]);
+}
+
+id<WebDeviceOrientationProvider> WebDeviceOrientationClient::getProvider() const
+{
+ if (!m_provider) {
+ m_provider = [m_webView _deviceOrientationProvider];
+ if ([m_provider respondsToSelector:@selector(setController:)])
+ objc_msgSend(m_provider, @selector(setController:), m_controller);
+ }
+ return m_provider;
+}
diff --git a/WebKit/mac/WebKit.exp b/WebKit/mac/WebKit.exp
index a22179f..463ab00 100644
--- a/WebKit/mac/WebKit.exp
+++ b/WebKit/mac/WebKit.exp
@@ -7,6 +7,8 @@
.objc_class_name_WebDataSource
.objc_class_name_WebDatabaseManager
.objc_class_name_WebDefaultPolicyDelegate
+.objc_class_name_WebDeviceOrientation
+.objc_class_name_WebDeviceOrientationProviderMock
.objc_class_name_WebDownload
.objc_class_name_WebDynamicScrollBarsView
.objc_class_name_WebFormDelegate
diff --git a/WebKit/mac/WebView/WebDeviceOrientation.h b/WebKit/mac/WebView/WebDeviceOrientation.h
new file mode 100644
index 0000000..ee04199
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientation.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+
+ at class WebDeviceOrientationInternal;
+
+ at interface WebDeviceOrientation : NSObject {
+ WebDeviceOrientationInternal* m_internal;
+}
+
+- (id)initWithCanProvideAlpha:(bool)canProvideAlpha alpha:(double)alpha canProvideBeta:(bool)canProvideBeta beta:(double)beta canProvideGamma:(bool)canProvideGamma gamma:(double)gamma;
+
+ at end
diff --git a/WebKit/mac/WebView/WebDeviceOrientation.mm b/WebKit/mac/WebView/WebDeviceOrientation.mm
new file mode 100644
index 0000000..7be5d0c
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientation.mm
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientationInternal.h"
+
+using namespace WebCore;
+
+ at implementation WebDeviceOrientationInternal
+
+- (id)initWithCoreDeviceOrientation:(PassRefPtr<DeviceOrientation>)coreDeviceOrientation
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ m_orientation = coreDeviceOrientation;
+ return self;
+}
+
+ at end
+
+ at implementation WebDeviceOrientation (Internal)
+
+- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientation>)coreDeviceOrientation
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:coreDeviceOrientation];
+ return self;
+}
+
+ at end
+
+ at implementation WebDeviceOrientation
+
+DeviceOrientation* core(WebDeviceOrientation* orientation)
+{
+ return orientation ? orientation->m_internal->m_orientation.get() : 0;
+}
+
+- (id)initWithCanProvideAlpha:(bool)canProvideAlpha alpha:(double)alpha canProvideBeta:(bool)canProvideBeta beta:(double)beta canProvideGamma:(bool)canProvideGamma gamma:(double)gamma
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientation::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)];
+ return self;
+}
+
+- (void)dealloc
+{
+ [m_internal release];
+ [super dealloc];
+}
+
+ at end
diff --git a/WebKit/mac/WebView/WebDeviceOrientationInternal.h b/WebKit/mac/WebView/WebDeviceOrientationInternal.h
new file mode 100644
index 0000000..b7c6aa5
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientationInternal.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientation.h"
+
+#import <WebCore/DeviceOrientation.h>
+#import <wtf/RefPtr.h>
+
+ at interface WebDeviceOrientationInternal : NSObject {
+ at public
+ RefPtr<WebCore::DeviceOrientation> m_orientation;
+}
+
+- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientation>)coreDeviceOrientation;
+ at end
+
+ at interface WebDeviceOrientation (Internal)
+
+- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientation>)coreDeviceOrientation;
+
+ at end
+
+WebCore::DeviceOrientation* core(WebDeviceOrientation*);
diff --git a/WebKit/mac/WebView/WebDeviceOrientationProvider.h b/WebKit/mac/WebView/WebDeviceOrientationProvider.h
new file mode 100644
index 0000000..18b688c
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientationProvider.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+ at class WebDeviceOrientation;
+
+ at protocol WebDeviceOrientationProvider <NSObject>
+- (void)startUpdating;
+- (void)stopUpdating;
+- (WebDeviceOrientation*)lastOrientation;
+ at end
diff --git a/WebKit/mac/WebView/WebDeviceOrientationProviderMock.h b/WebKit/mac/WebView/WebDeviceOrientationProviderMock.h
new file mode 100644
index 0000000..be5a764
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientationProviderMock.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientationProvider.h"
+
+ at class WebDeviceOrientationProviderMockInternal;
+ at class WebDeviceOrientation;
+
+ at interface WebDeviceOrientationProviderMock : NSObject<WebDeviceOrientationProvider> {
+ WebDeviceOrientationProviderMockInternal* m_internal;
+}
+
+- (id)init;
+- (void)setOrientation:(WebDeviceOrientation*)orientation;
+
+ at end
diff --git a/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm b/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm
new file mode 100644
index 0000000..13bd455
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientationProviderMockInternal.h"
+
+#import "WebDeviceOrientationInternal.h"
+
+using namespace WebCore;
+
+ at implementation WebDeviceOrientationProviderMockInternal
+
+- (id)init
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ m_core.set(new DeviceOrientationClientMock());
+ return self;
+}
+
+- (void)setOrientation:(WebDeviceOrientation*)orientation
+{
+ m_core->setOrientation(core(orientation));
+}
+
+- (void)setController:(DeviceOrientationController*)controller
+{
+ m_core->setController(controller);
+}
+
+- (void)startUpdating
+{
+ m_core->startUpdating();
+}
+
+- (void)stopUpdating
+{
+ m_core->stopUpdating();
+}
+
+- (WebDeviceOrientation*)lastOrientation
+{
+ return [[WebDeviceOrientation alloc] initWithCoreDeviceOrientation:m_core->lastOrientation()];
+}
+
+ at end
+
+ at implementation WebDeviceOrientationProviderMock (Internal)
+
+- (void)setController:(WebCore::DeviceOrientationController*)controller
+{
+ [m_internal setController:controller];
+}
+
+ at end
+
+ at implementation WebDeviceOrientationProviderMock
+
+- (id)init;
+{
+ self = [super init];
+ if (!self)
+ return nil;
+ m_internal = [[WebDeviceOrientationProviderMockInternal alloc] init];
+ return self;
+}
+
+- (void)dealloc
+{
+ [super dealloc];
+ [m_internal release];
+}
+
+- (void)setOrientation:(WebDeviceOrientation*)orientation
+{
+ [m_internal setOrientation:orientation];
+}
+
+- (void)startUpdating
+{
+ [m_internal startUpdating];
+}
+
+- (void)stopUpdating
+{
+ [m_internal stopUpdating];
+}
+
+- (WebDeviceOrientation*)lastOrientation
+{
+ return [m_internal lastOrientation];
+}
+
+ at end
diff --git a/WebKit/mac/WebView/WebDeviceOrientationProviderMockInternal.h b/WebKit/mac/WebView/WebDeviceOrientationProviderMockInternal.h
new file mode 100644
index 0000000..5ac38e5
--- /dev/null
+++ b/WebKit/mac/WebView/WebDeviceOrientationProviderMockInternal.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#import "WebDeviceOrientationProviderMock.h"
+
+#import <WebCore/DeviceOrientationClientMock.h>
+#import <wtf/OwnPtr.h>
+
+ at interface WebDeviceOrientationProviderMockInternal : NSObject {
+ OwnPtr<WebCore::DeviceOrientationClientMock> m_core;
+}
+
+- (id)init;
+
+- (void)setOrientation:(WebDeviceOrientation*)orientation;
+
+- (void)setController:(WebCore::DeviceOrientationController*)controller;
+
+- (void)startUpdating;
+- (void)stopUpdating;
+- (WebDeviceOrientation*)lastOrientation;
+ at end
+
+ at interface WebDeviceOrientationProviderMock (Internal)
+- (void)setController:(WebCore::DeviceOrientationController*)controller;
+ at end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index f2e76c1..8b2f0ed 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -47,6 +47,8 @@
#import "WebDefaultPolicyDelegate.h"
#import "WebDefaultUIDelegate.h"
#import "WebDelegateImplementationCaching.h"
+#import "WebDeviceOrientationClient.h"
+#import "WebDeviceOrientationProvider.h"
#import "WebDocument.h"
#import "WebDocumentInternal.h"
#import "WebDownload.h"
@@ -683,6 +685,9 @@ static bool shouldEnableLoadDeferring()
#if ENABLE(CLIENT_BASED_GEOLOCATION)
pageClients.geolocationControllerClient = new WebGeolocationControllerClient(self);
#endif
+#if ENABLE(DEVICE_ORIENTATION)
+ pageClients.deviceOrientationClient = new WebDeviceOrientationClient(self);
+#endif
_private->page = new Page(pageClients);
_private->page->setCanStartMedia([self window]);
@@ -5883,6 +5888,23 @@ static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity
@end
+ at implementation WebView (WebViewDeviceOrientation)
+
+- (void)_setDeviceOrientationProvider:(id<WebDeviceOrientationProvider>)deviceOrientationProvider
+{
+ if (_private)
+ _private->m_deviceOrientationProvider = deviceOrientationProvider;
+}
+
+- (id<WebDeviceOrientationProvider>)_deviceOrientationProvider
+{
+ if (_private)
+ return _private->m_deviceOrientationProvider;
+ return nil;
+}
+
+ at end
+
@implementation WebView (WebViewGeolocation)
- (void)_setGeolocationProvider:(id<WebGeolocationProvider>)geolocationProvider
diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h
index 3b80a89..a9d2b9e 100644
--- a/WebKit/mac/WebView/WebViewData.h
+++ b/WebKit/mac/WebView/WebViewData.h
@@ -38,12 +38,14 @@ namespace WebCore {
class Page;
}
+ at class WebDeviceOrientationClient;
@class WebInspector;
@class WebNodeHighlight;
@class WebPluginDatabase;
@class WebPreferences;
@class WebTextCompletionController;
@protocol WebFormDelegate;
+ at protocol WebDeviceOrientationProvider;
@protocol WebGeolocationProvider;
#if ENABLE(VIDEO)
@class WebVideoFullscreenController;
@@ -174,5 +176,6 @@ extern int pluginDatabaseClientCount;
CFRunLoopObserverRef glibRunLoopObserver;
#endif
id<WebGeolocationProvider> _geolocationProvider;
+ id<WebDeviceOrientationProvider> m_deviceOrientationProvider;
}
@end
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index 28348cc..aeb36c7 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -44,12 +44,14 @@
@class NSError;
@class WebFrame;
+ at class WebDeviceOrientation;
@class WebGeolocationPosition;
@class WebInspector;
@class WebPreferences;
@class WebScriptWorld;
@class WebTextIterator;
+ at protocol WebDeviceOrientationProvider;
@protocol WebFormDelegate;
extern NSString *_WebCanGoBackKey;
@@ -605,6 +607,11 @@ Could be worth adding to the API.
- (BOOL)_selectionIsAll;
@end
+ at interface WebView (WebViewDeviceOrientation)
+- (void)_setDeviceOrientationProvider:(id<WebDeviceOrientationProvider>)deviceOrientationProvider;
+- (id<WebDeviceOrientationProvider>)_deviceOrientationProvider;
+ at end
+
@protocol WebGeolocationProvider <NSObject>
- (void)registerWebView:(WebView *)webView;
- (void)unregisterWebView:(WebView *)webView;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 7ed25fa..a591d92 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-02 Steve Block <steveblock at google.com>
+
+ Reviewed by Adam Barth.
+
+ Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
+ https://bugs.webkit.org/show_bug.cgi?id=43181
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockDeviceOrientation):
+
2010-08-31 Adam Roben <aroben at apple.com>
Fix flashiness when resizing the browser window on Windows
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index e756ebf..ffcb18a 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -62,6 +62,7 @@
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebDatabaseManagerPrivate.h>
#import <WebKit/WebDocumentPrivate.h>
+#import <WebKit/WebDeviceOrientationProviderMock.h>
#import <WebKit/WebEditingDelegate.h>
#import <WebKit/WebFrameView.h>
#import <WebKit/WebHTMLRepresentationInternal.h>
@@ -292,6 +293,7 @@ WebView *createWebViewAndOffscreenWindow()
[webView setEditingDelegate:editingDelegate];
[webView setResourceLoadDelegate:resourceLoadDelegate];
[webView _setGeolocationProvider:[MockGeolocationProvider shared]];
+ [webView _setDeviceOrientationProvider:[[WebDeviceOrientationProviderMock alloc] init]];
// Register the same schemes that Safari does
[WebView registerURLSchemeAsLocal:@"feed"];
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 97c177d..f55093e 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -45,9 +45,11 @@
#import <WebKit/WebApplicationCache.h>
#import <WebKit/WebBackForwardList.h>
#import <WebKit/WebCoreStatistics.h>
+#import <WebKit/WebDOMOperationsPrivate.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDatabaseManagerPrivate.h>
-#import <WebKit/WebDOMOperationsPrivate.h>
+#import <WebKit/WebDeviceOrientation.h>
+#import <WebKit/WebDeviceOrientationProviderMock.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFrameViewPrivate.h>
#import <WebKit/WebGeolocationPosition.h>
@@ -336,9 +338,11 @@ void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidd
void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
{
- // FIXME: Implement for DeviceOrientation layout tests.
- // See https://bugs.webkit.org/show_bug.cgi?id=30335.
-
+ // DumpRenderTree configured the WebView to use WebDeviceOrientationProviderMock.
+ id<WebDeviceOrientationProvider> provider = [[mainFrame webView] _deviceOrientationProvider];
+ WebDeviceOrientationProviderMock* mockProvider = static_cast<WebDeviceOrientationProviderMock*>(provider);
+ WebDeviceOrientation* orientation = [[WebDeviceOrientation alloc] initWithCanProvideAlpha:canProvideAlpha alpha:alpha canProvideBeta:canProvideBeta beta:beta canProvideGamma:canProvideGamma gamma:gamma];
+ [mockProvider setOrientation:orientation];
}
void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list