[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

mpcomplete at chromium.org mpcomplete at chromium.org
Thu Feb 4 21:35:41 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit bf2ebe460c16c72176d81912678c2e0c3036f78a
Author: mpcomplete at chromium.org <mpcomplete at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 1 22:29:06 2010 +0000

    Add support for addUserScript to chromium port.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 34eacf7..778ea15 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-27  Matt Perry  <mpcomplete at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Add support for addUserScript to chromium port.
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInWorld):
+        * bindings/v8/ScriptController.h:
+
 2010-02-01  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 8db55a1..89ff9fa 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -353,6 +353,15 @@ void ScriptController::getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
     worlds.append(mainThreadNormalWorld());
 }
 
+void ScriptController::evaluateInWorld(const ScriptSourceCode& source,
+                                       DOMWrapperWorld* world)
+{
+    Vector<ScriptSourceCode> sources;
+    sources.append(source);
+    // FIXME: Get an ID from the world param.
+    evaluateInIsolatedWorld(0, sources);
+}
+
 static NPObject* createNoScriptObject()
 {
     notImplemented();
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index b45bdef..a361b39 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -165,7 +165,7 @@ public:
 #endif
 
     // Dummy method to avoid a bunch of ifdef's in WebCore.
-    void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*) { }
+    void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
     static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
 
 private:
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 05de9a3..3ea348c 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-27  Matt Perry  <mpcomplete at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Add support for addUserScript to chromium port.
+
+        * public/WebView.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::addUserScript):
+        (WebKit::WebViewImpl::removeAllUserContent):
+        * src/WebViewImpl.h:
+
 2010-01-29  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Eric Carlson.
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index aba556c..7b3294f 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -262,6 +262,10 @@ public:
                                     unsigned inactiveBackgroundColor,
                                     unsigned inactiveForegroundColor) = 0;
 
+    // User scripts --------------------------------------------------------
+    virtual void addUserScript(const WebString& sourceCode,
+                               bool runAtStart) = 0;
+    virtual void removeAllUserContent() = 0;
 
     // Modal dialog support ------------------------------------------------
 
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 97825e9..cdf3bba 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -1694,6 +1694,20 @@ void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor,
 #endif
 }
 
+void WebViewImpl::addUserScript(const WebString& sourceCode, bool runAtStart)
+{
+    PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
+    RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::create());
+    pageGroup->addUserScriptToWorld(world.get(), sourceCode, WebURL(), 0, 0,
+                                    runAtStart ? InjectAtDocumentStart : InjectAtDocumentEnd);
+}
+
+void WebViewImpl::removeAllUserContent()
+{
+    PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
+    pageGroup->removeAllUserContent();
+}
+
 void WebViewImpl::didCommitLoad(bool* isNewNavigation)
 {
     if (isNewNavigation)
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index ed5cc5f..e2292f4 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -162,6 +162,9 @@ public:
                                     unsigned inactiveBackgroundColor,
                                     unsigned inactiveForegroundColor);
     virtual void performCustomContextMenuAction(unsigned action);
+    virtual void addUserScript(const WebString& sourceCode,
+                               bool runAtStart);
+    virtual void removeAllUserContent();
 
     // WebViewImpl
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list