From 6b70adc33054f8aee8c54d0f460458a9df11b8a5 Mon Sep 17 00:00:00 2001 From: Russell Brenner Date: Thu, 18 Nov 2010 17:33:13 -0800 Subject: Merge WebKit at r72274: Initial merge by git. Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb --- WebKit/win/WebCoreSupport/WebGeolocationClient.cpp | 74 ++++++++++++++++++++++ WebKit/win/WebCoreSupport/WebGeolocationClient.h | 52 +++++++++++++++ .../WebGeolocationControllerClient.cpp | 74 ---------------------- .../WebGeolocationControllerClient.h | 52 --------------- 4 files changed, 126 insertions(+), 126 deletions(-) create mode 100644 WebKit/win/WebCoreSupport/WebGeolocationClient.cpp create mode 100644 WebKit/win/WebCoreSupport/WebGeolocationClient.h delete mode 100644 WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp delete mode 100644 WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h (limited to 'WebKit/win/WebCoreSupport') diff --git a/WebKit/win/WebCoreSupport/WebGeolocationClient.cpp b/WebKit/win/WebCoreSupport/WebGeolocationClient.cpp new file mode 100644 index 0000000..8a526c4 --- /dev/null +++ b/WebKit/win/WebCoreSupport/WebGeolocationClient.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010 Apple 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: + * 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. + */ + +#include "config.h" +#include "WebKitDLL.h" +#include "WebGeolocationClient.h" + +#include "WebGeolocationPosition.h" +#include "WebView.h" + +using namespace WebCore; + +WebGeolocationClient::WebGeolocationClient(WebView* webView) + : m_webView(webView) +{ +} + +void WebGeolocationClient::geolocationDestroyed() +{ + delete this; +} + +void WebGeolocationClient::startUpdating() +{ + COMPtr provider; + if (FAILED(m_webView->geolocationProvider(&provider))) + return; + provider->registerWebView(m_webView.get()); +} + +void WebGeolocationClient::stopUpdating() +{ + COMPtr provider; + if (FAILED(m_webView->geolocationProvider(&provider))) + return; + provider->unregisterWebView(m_webView.get()); +} + +GeolocationPosition* WebGeolocationClient::lastPosition() +{ +#if ENABLE(CLIENT_BASED_GEOLOCATION) + COMPtr provider; + if (FAILED(m_webView->geolocationProvider(&provider))) + return 0; + COMPtr position; + if (FAILED(provider->lastPosition(&position))) + return 0; + return core(position.get()); +#else + return 0; +#endif +} diff --git a/WebKit/win/WebCoreSupport/WebGeolocationClient.h b/WebKit/win/WebCoreSupport/WebGeolocationClient.h new file mode 100644 index 0000000..2422ae5 --- /dev/null +++ b/WebKit/win/WebCoreSupport/WebGeolocationClient.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 Apple 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: + * 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 WebGeolocationClient_h +#define WebGeolocationClient_h + +#include "COMPtr.h" +#include + +namespace WebCore { + class GeolocationPosition; +} + +class WebView; + +class WebGeolocationClient : public WebCore::GeolocationClient { +public: + WebGeolocationClient(WebView*); + + virtual void geolocationDestroyed(); + virtual void startUpdating(); + virtual void stopUpdating(); + virtual void setEnableHighAccuracy(bool) { } + virtual WebCore::GeolocationPosition* lastPosition(); + +private: + COMPtr m_webView; +}; + +#endif // WebGeolocationClient_h diff --git a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp deleted file mode 100644 index daacd6c..0000000 --- a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2010 Apple 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: - * 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. - */ - -#include "config.h" -#include "WebKitDLL.h" -#include "WebGeolocationControllerClient.h" - -#include "WebGeolocationPosition.h" -#include "WebView.h" - -using namespace WebCore; - -WebGeolocationControllerClient::WebGeolocationControllerClient(WebView* webView) - : m_webView(webView) -{ -} - -void WebGeolocationControllerClient::geolocationDestroyed() -{ - delete this; -} - -void WebGeolocationControllerClient::startUpdating() -{ - COMPtr provider; - if (FAILED(m_webView->geolocationProvider(&provider))) - return; - provider->registerWebView(m_webView.get()); -} - -void WebGeolocationControllerClient::stopUpdating() -{ - COMPtr provider; - if (FAILED(m_webView->geolocationProvider(&provider))) - return; - provider->unregisterWebView(m_webView.get()); -} - -GeolocationPosition* WebGeolocationControllerClient::lastPosition() -{ -#if ENABLE(CLIENT_BASED_GEOLOCATION) - COMPtr provider; - if (FAILED(m_webView->geolocationProvider(&provider))) - return 0; - COMPtr position; - if (FAILED(provider->lastPosition(&position))) - return 0; - return core(position.get()); -#else - return 0; -#endif -} diff --git a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h deleted file mode 100644 index ed73454..0000000 --- a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2010 Apple 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: - * 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 WebGeolocationControllerClient_h -#define WebGeolocationControllerClient_h - -#include "COMPtr.h" -#include - -namespace WebCore { - class GeolocationPosition; -} - -class WebView; - -class WebGeolocationControllerClient : public WebCore::GeolocationControllerClient { -public: - WebGeolocationControllerClient(WebView*); - - virtual void geolocationDestroyed(); - virtual void startUpdating(); - virtual void stopUpdating(); - virtual void setEnableHighAccuracy(bool) { } - virtual WebCore::GeolocationPosition* lastPosition(); - -private: - COMPtr m_webView; -}; - -#endif // WebGeolocationControllerClient_h -- cgit v1.1