Commit b15462d1 authored by eric@webkit.org's avatar eric@webkit.org

2010-01-18 Jonathan Dixon <joth@chromium.org>

        Reviewed by Adam Barth.

        Add support for enabling navigator.geolocation at runtime in the V8 bindings.
        Adds the [EnabledAtRuntime] modifier to the navigator IDL.
        https://bugs.webkit.org/show_bug.cgi?id=33467

        * WebCore.gypi:
        * bindings/v8/RuntimeEnabledFeatures.cpp:
        * bindings/v8/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setGeolocationEnabled):
        (WebCore::RuntimeEnabledFeatures::geolocationEnabled):
        * bindings/v8/custom/V8NavigatorCustom.cpp: Added.
        (WebCore::V8Navigator::GeolocationEnabled):
        * page/Navigator.cpp:
        (WebCore::Navigator::geolocation):
        * page/Navigator.idl:
2010-01-18  Jonathan Dixon  <joth@chromium.org>

        Reviewed by Adam Barth.

        Add support for enabling navigator.geolocation at runtime in the V8 bindings.
        Adds the [EnabledAtRuntime] modifier to the navigator IDL.
        https://bugs.webkit.org/show_bug.cgi?id=33467

        * public/WebRuntimeFeatures.h:
        * src/WebRuntimeFeatures.cpp:
        (WebKit::WebRuntimeFeatures::enableGeolocation):
        (WebKit::WebRuntimeFeatures::isGeolocationEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 661dd345
2010-01-18 Jonathan Dixon <joth@chromium.org>
Reviewed by Adam Barth.
Add support for enabling navigator.geolocation at runtime in the V8 bindings.
Adds the [EnabledAtRuntime] modifier to the navigator IDL.
https://bugs.webkit.org/show_bug.cgi?id=33467
* WebCore.gypi:
* bindings/v8/RuntimeEnabledFeatures.cpp:
* bindings/v8/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setGeolocationEnabled):
(WebCore::RuntimeEnabledFeatures::geolocationEnabled):
* bindings/v8/custom/V8NavigatorCustom.cpp: Added.
(WebCore::V8Navigator::GeolocationEnabled):
* page/Navigator.cpp:
(WebCore::Navigator::geolocation):
* page/Navigator.idl:
2010-01-18 Alexander Pavlov <apavlov@chromium.org>
Reviewed by Pavel Feldman.
......@@ -720,6 +720,7 @@
'bindings/v8/custom/V8NamedNodeMapCustom.cpp',
'bindings/v8/custom/V8NamedNodesCollection.cpp',
'bindings/v8/custom/V8NamedNodesCollection.h',
'bindings/v8/custom/V8NavigatorCustom.cpp',
'bindings/v8/custom/V8NodeCustom.cpp',
'bindings/v8/custom/V8NodeFilterCustom.cpp',
'bindings/v8/custom/V8NodeIteratorCustom.cpp',
......
......@@ -38,5 +38,6 @@ bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
bool RuntimeEnabledFeatures::isNotificationsEnabled = false;
bool RuntimeEnabledFeatures::isApplicationCacheEnabled = false;
bool RuntimeEnabledFeatures::isGeolocationEnabled = false;
} // namespace WebCore
......@@ -51,6 +51,9 @@ public:
static void setApplicationCacheEnabled(bool isEnabled) { isApplicationCacheEnabled = isEnabled; }
static bool applicationCacheEnabled() { return isApplicationCacheEnabled; }
static void setGeolocationEnabled(bool isEnabled) { isGeolocationEnabled = isEnabled; }
static bool geolocationEnabled() { return isGeolocationEnabled; }
private:
// Never instantiate.
RuntimeEnabledFeatures() { }
......@@ -60,6 +63,7 @@ private:
static bool isSessionStorageEnabled;
static bool isNotificationsEnabled;
static bool isApplicationCacheEnabled;
static bool isGeolocationEnabled;
};
} // namespace WebCore
......
/*
* 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.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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 "V8Navigator.h"
#include "RuntimeEnabledFeatures.h"
namespace WebCore {
#if ENABLE(GEOLOCATION)
bool V8Navigator::GeolocationEnabled()
{
return RuntimeEnabledFeatures::geolocationEnabled();
}
#endif
} // namespace WebCore
......@@ -41,7 +41,7 @@ module window {
readonly attribute boolean onLine;
#if defined(ENABLE_GEOLOCATION) && ENABLE_GEOLOCATION
readonly attribute Geolocation geolocation;
readonly attribute [EnabledAtRuntime] Geolocation geolocation;
#endif
#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
......
2010-01-18 Jonathan Dixon <joth@chromium.org>
Reviewed by Adam Barth.
Add support for enabling navigator.geolocation at runtime in the V8 bindings.
Adds the [EnabledAtRuntime] modifier to the navigator IDL.
https://bugs.webkit.org/show_bug.cgi?id=33467
* public/WebRuntimeFeatures.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableGeolocation):
(WebKit::WebRuntimeFeatures::isGeolocationEnabled):
2010-01-17 Kent Tamura <tkent@chromium.org>
Reviewed by Shinichiro Hamaji.
......
......@@ -62,6 +62,9 @@ public:
WEBKIT_API static void enableApplicationCache(bool);
WEBKIT_API static bool isApplicationCacheEnabled();
WEBKIT_API static void enableGeolocation(bool);
WEBKIT_API static bool isGeolocationEnabled();
private:
WebRuntimeFeatures();
};
......
......@@ -151,4 +151,20 @@ bool WebRuntimeFeatures::isApplicationCacheEnabled()
#endif
}
void WebRuntimeFeatures::enableGeolocation(bool enable)
{
#if ENABLE(GEOLOCATION)
RuntimeEnabledFeatures::setGeolocationEnabled(enable);
#endif
}
bool WebRuntimeFeatures::isGeolocationEnabled()
{
#if ENABLE(GEOLOCATION)
return RuntimeEnabledFeatures::geolocationEnabled();
#else
return false;
#endif
}
} // namespace WebKit
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment