[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

kenneth at webkit.org kenneth at webkit.org
Wed Dec 22 13:41:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0ff245fbbd885aaf8672b53466ab3b2f29956143
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 23 17:11:18 2010 +0000

    Add a preference class for Qt for WebKit2.
    
    Reviewed by Andreas Kling.
    
    * UIProcess/API/qt/qwkpreferences.cpp: Added.
    (QWKPreferences::globalPreferences):
    (QWKPreferences::QWKPreferences):
    (QWKPreferences::~QWKPreferences):
    (QWKPreferences::testAttribute):
    (QWKPreferences::setAttribute):
    * UIProcess/API/qt/qwkpreferences.h: Added.
    * WebKit2.pro:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index c38cfdc..78395fd 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-23  Kenneth Rohde Christiansen  <kenneth.christiansen at openbossa.org>
+
+        Reviewed by Andreas Kling.
+
+        Add a preference class for Qt for WebKit2.
+
+        * UIProcess/API/qt/qwkpreferences.cpp: Added.
+        (QWKPreferences::globalPreferences):
+        (QWKPreferences::QWKPreferences):
+        (QWKPreferences::~QWKPreferences):
+        (QWKPreferences::testAttribute):
+        (QWKPreferences::setAttribute):
+        * UIProcess/API/qt/qwkpreferences.h: Added.
+        * WebKit2.pro:
+
 2010-09-23  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKit2/UIProcess/API/qt/qwkpreferences.cpp b/WebKit2/UIProcess/API/qt/qwkpreferences.cpp
new file mode 100644
index 0000000..5432ab8
--- /dev/null
+++ b/WebKit2/UIProcess/API/qt/qwkpreferences.cpp
@@ -0,0 +1,83 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "qwkpreferences.h"
+#include "WKPreferences.h"
+
+class QWKPreferencesPrivate {
+public:
+    WKPreferencesRef ref;
+};
+
+QWKPreferences* QWKPreferences::globalPreferences()
+{
+    static QWKPreferences* instance = 0;
+
+    if (!instance)
+        instance = new QWKPreferences;
+    return instance;
+}
+
+QWKPreferences::QWKPreferences()
+    : d(new QWKPreferencesPrivate)
+{
+    d->ref = WKPreferencesCreate();
+}
+
+QWKPreferences::~QWKPreferences()
+{
+    delete d;
+}
+
+bool QWKPreferences::testAttribute(WebAttribute attr) const
+{
+    switch (attr) {
+    case AutoLoadImages:
+        return WKPreferencesGetLoadsImagesAutomatically(d->ref);
+    case JavascriptEnabled:
+        return WKPreferencesGetJavaScriptEnabled(d->ref);
+    case OfflineWebApplicationCacheEnabled:
+        return WKPreferencesGetOfflineWebApplicationCacheEnabled(d->ref);
+    case LocalStorageEnabled:
+        return WKPreferencesGetLocalStorageEnabled(d->ref);
+    case XSSAuditingEnabled:
+        return WKPreferencesGetXSSAuditorEnabled(d->ref);
+    default:
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+}
+
+void QWKPreferences::setAttribute(WebAttribute attr, bool on)
+{
+    switch (attr) {
+    case AutoLoadImages:
+        return WKPreferencesSetLoadsImagesAutomatically(d->ref, on);
+    case JavascriptEnabled:
+        return WKPreferencesSetJavaScriptEnabled(d->ref, on);
+    case OfflineWebApplicationCacheEnabled:
+        return WKPreferencesSetOfflineWebApplicationCacheEnabled(d->ref, on);
+    case LocalStorageEnabled:
+        return WKPreferencesSetLocalStorageEnabled(d->ref, on);
+    case XSSAuditingEnabled:
+        return WKPreferencesSetXSSAuditorEnabled(d->ref, on);
+    default:
+        ASSERT_NOT_REACHED();
+    }
+}
diff --git a/WebKit2/UIProcess/API/qt/qwkpreferences.h b/WebKit2/UIProcess/API/qt/qwkpreferences.h
new file mode 100644
index 0000000..4fe4ee8
--- /dev/null
+++ b/WebKit2/UIProcess/API/qt/qwkpreferences.h
@@ -0,0 +1,51 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWKPREFERENCES_H
+#define QWKPREFERENCES_H
+
+#include "qwebkitglobal.h"
+
+class QWKPreferencesPrivate;
+
+class QWEBKIT_EXPORT QWKPreferences {
+public:
+    enum WebAttribute {
+        AutoLoadImages,
+        JavascriptEnabled,
+        OfflineWebApplicationCacheEnabled,
+        LocalStorageEnabled,
+        XSSAuditingEnabled
+    };
+
+    static QWKPreferences* globalPreferences();
+
+    void setAttribute(WebAttribute attr, bool on);
+    bool testAttribute(WebAttribute attr) const;
+
+private:
+    Q_DISABLE_COPY(QWKPreferences)
+
+    QWKPreferences();
+    ~QWKPreferences();
+
+    QWKPreferencesPrivate *d;
+};
+
+#endif // QWKPREFERENCES_H
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index c4dce39..e93082a 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -209,6 +209,7 @@ HEADERS += \
     UIProcess/API/qt/qgraphicswkview.h \
     UIProcess/API/qt/qwkpage.h \
     UIProcess/API/qt/qwkpage_p.h \
+    UIProcess/API/qt/qwkpreferences.h \
     UIProcess/ChunkedUpdateDrawingAreaProxy.h \
     UIProcess/DrawingAreaProxy.h \
     UIProcess/GenericCallback.h \
@@ -326,6 +327,7 @@ SOURCES += \
     UIProcess/API/qt/ClientImpl.cpp \
     UIProcess/API/qt/qgraphicswkview.cpp \
     UIProcess/API/qt/qwkpage.cpp \
+    UIProcess/API/qt/qwkpreferences.cpp \
     UIProcess/API/cpp/qt/WKStringQt.cpp \
     UIProcess/API/cpp/qt/WKURLQt.cpp \
     UIProcess/ChunkedUpdateDrawingAreaProxy.cpp \

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list