Changeset 53406 in webkit


Ignore:
Timestamp:
Jan 18, 2010 6:37:01 AM (14 years ago)
Author:
eric@webkit.org
Message:

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):
Location:
trunk
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53405 r53406  
     12010-01-18  Jonathan Dixon  <joth@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Add support for enabling navigator.geolocation at runtime in the V8 bindings.
     6        Adds the [EnabledAtRuntime] modifier to the navigator IDL.
     7        https://bugs.webkit.org/show_bug.cgi?id=33467
     8
     9        * WebCore.gypi:
     10        * bindings/v8/RuntimeEnabledFeatures.cpp:
     11        * bindings/v8/RuntimeEnabledFeatures.h:
     12        (WebCore::RuntimeEnabledFeatures::setGeolocationEnabled):
     13        (WebCore::RuntimeEnabledFeatures::geolocationEnabled):
     14        * bindings/v8/custom/V8NavigatorCustom.cpp: Added.
     15        (WebCore::V8Navigator::GeolocationEnabled):
     16        * page/Navigator.cpp:
     17        (WebCore::Navigator::geolocation):
     18        * page/Navigator.idl:
     19
    1202010-01-18  Alexander Pavlov  <apavlov@chromium.org>
    221
  • trunk/WebCore/WebCore.gypi

    r53347 r53406  
    721721            'bindings/v8/custom/V8NamedNodesCollection.cpp',
    722722            'bindings/v8/custom/V8NamedNodesCollection.h',
     723            'bindings/v8/custom/V8NavigatorCustom.cpp',
    723724            'bindings/v8/custom/V8NodeCustom.cpp',
    724725            'bindings/v8/custom/V8NodeFilterCustom.cpp',
  • trunk/WebCore/bindings/v8/RuntimeEnabledFeatures.cpp

    r50534 r53406  
    3939bool RuntimeEnabledFeatures::isNotificationsEnabled = false;
    4040bool RuntimeEnabledFeatures::isApplicationCacheEnabled = false;
     41bool RuntimeEnabledFeatures::isGeolocationEnabled = false;
    4142
    4243} // namespace WebCore
  • trunk/WebCore/bindings/v8/RuntimeEnabledFeatures.h

    r50534 r53406  
    5252    static bool applicationCacheEnabled() { return isApplicationCacheEnabled; }
    5353
     54    static void setGeolocationEnabled(bool isEnabled) { isGeolocationEnabled = isEnabled; }
     55    static bool geolocationEnabled() { return isGeolocationEnabled; }
     56
    5457private:
    5558    // Never instantiate.
     
    6164    static bool isNotificationsEnabled;
    6265    static bool isApplicationCacheEnabled;
     66    static bool isGeolocationEnabled;
    6367};
    6468
  • trunk/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp

    r53405 r53406  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
    3  *
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
     3 * 
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions are
    66 * met:
    7  *
     7 * 
    88 *     * Redistributions of source code must retain the above copyright
    99 * notice, this list of conditions and the following disclaimer.
     
    1515 * contributors may be used to endorse or promote products derived from
    1616 * this software without specific prior written permission.
    17  *
     17 * 
    1818 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1919 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     
    3030
    3131#include "config.h"
     32#include "V8Navigator.h"
     33
    3234#include "RuntimeEnabledFeatures.h"
    3335
    3436namespace WebCore {
    3537
    36 bool RuntimeEnabledFeatures::isDatabaseEnabled = false;
    37 bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
    38 bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
    39 bool RuntimeEnabledFeatures::isNotificationsEnabled = false;
    40 bool RuntimeEnabledFeatures::isApplicationCacheEnabled = false;
     38#if ENABLE(GEOLOCATION)
     39bool V8Navigator::GeolocationEnabled()
     40{
     41    return RuntimeEnabledFeatures::geolocationEnabled();
     42}
     43#endif
    4144
    4245} // namespace WebCore
  • trunk/WebCore/page/Navigator.idl

    r52534 r53406  
    4242
    4343#if defined(ENABLE_GEOLOCATION) && ENABLE_GEOLOCATION
    44         readonly attribute Geolocation geolocation;
     44        readonly attribute [EnabledAtRuntime] Geolocation geolocation;
    4545#endif
    4646
  • trunk/WebKit/chromium/ChangeLog

    r53389 r53406  
     12010-01-18  Jonathan Dixon  <joth@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Add support for enabling navigator.geolocation at runtime in the V8 bindings.
     6        Adds the [EnabledAtRuntime] modifier to the navigator IDL.
     7        https://bugs.webkit.org/show_bug.cgi?id=33467
     8
     9        * public/WebRuntimeFeatures.h:
     10        * src/WebRuntimeFeatures.cpp:
     11        (WebKit::WebRuntimeFeatures::enableGeolocation):
     12        (WebKit::WebRuntimeFeatures::isGeolocationEnabled):
     13
    1142010-01-17  Kent Tamura  <tkent@chromium.org>
    215
  • trunk/WebKit/chromium/public/WebRuntimeFeatures.h

    r50717 r53406  
    6363    WEBKIT_API static bool isApplicationCacheEnabled();
    6464
     65    WEBKIT_API static void enableGeolocation(bool);
     66    WEBKIT_API static bool isGeolocationEnabled();
     67
    6568private:
    6669    WebRuntimeFeatures();
  • trunk/WebKit/chromium/src/WebRuntimeFeatures.cpp

    r50722 r53406  
    152152}
    153153
     154void WebRuntimeFeatures::enableGeolocation(bool enable)
     155{
     156#if ENABLE(GEOLOCATION)
     157    RuntimeEnabledFeatures::setGeolocationEnabled(enable);
     158#endif
     159}
     160
     161bool WebRuntimeFeatures::isGeolocationEnabled()
     162{
     163#if ENABLE(GEOLOCATION)
     164    return RuntimeEnabledFeatures::geolocationEnabled();
     165#else
     166    return false;
     167#endif
     168}
     169
    154170} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.