Reviewed by Anders.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2006 05:46:02 +0000 (05:46 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2006 05:46:02 +0000 (05:46 +0000)
        - remove BrowserExtension

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/kjs_window.cpp:
        (KJS::createNewWindow):
        (KJS::WindowFunc::callAsFunction):
        * bridge/BrowserExtension.h: Removed.
        * bridge/mac/BrowserExtensionMac.h: Removed.
        * bridge/mac/BrowserExtensionMac.mm: Removed.
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::FrameMac):
        (WebCore::FrameMac::submitForm):
        (WebCore::FrameMac::urlSelected):
        * bridge/win/BrowserExtensionWin.cpp: Removed.
        * bridge/win/BrowserExtensionWin.h: Removed.
        * bridge/win/FrameWin.cpp:
        (WebCore::FrameWin::FrameWin):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::createWindow):
        * loader/FrameLoader.h:
        * loader/icon/IconLoader.cpp:
        * loader/mac/FrameLoaderMac.mm:
        (WebCore::FrameLoader::safeLoad):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::createWindow):
        * page/Frame.cpp:
        (WebCore::Frame::urlSelected):
        (WebCore::Frame::requestFrame):
        (WebCore::Frame::submitForm):
        (WebCore::Frame::scheduleHistoryNavigation):
        (WebCore::Frame::redirectionTimerFired):
        * page/Frame.h:
        * page/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::FrameLoadRequest):
        (WebCore::FrameLoadRequest::isEmpty):
        (WebCore::FrameLoadRequest::resourceRequest):
        (WebCore::FrameLoadRequest::frameName):
        (WebCore::FrameLoadRequest::setFrameName):
        * page/FramePrivate.h:
        (WebCore::FramePrivate::FramePrivate):
        (WebCore::FramePrivate::~FramePrivate):
        * platform/gdk/BrowserExtensionGdk.h: Removed.
        * platform/gdk/FrameGdk.cpp:
        (WebCore::FrameGdk::FrameGdk):
        * platform/gdk/TemporaryLinkStubs.cpp:
        * platform/network/ResourceRequest.h:
        (WebCore::ResourceRequest::isEmpty):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17471 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_window.cpp
WebCore/bridge/BrowserExtension.h [deleted file]
WebCore/bridge/mac/BrowserExtensionMac.h [deleted file]
WebCore/bridge/mac/BrowserExtensionMac.mm [deleted file]
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/win/BrowserExtensionWin.cpp [deleted file]
WebCore/bridge/win/BrowserExtensionWin.h [deleted file]
WebCore/bridge/win/FrameWin.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/icon/IconLoader.cpp
WebCore/loader/mac/FrameLoaderMac.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FrameLoadRequest.h
WebCore/page/FramePrivate.h
WebCore/platform/gdk/BrowserExtensionGdk.h [deleted file]
WebCore/platform/gdk/FrameGdk.cpp
WebCore/platform/gdk/TemporaryLinkStubs.cpp
WebCore/platform/network/ResourceRequest.h

index 1707038597d1fb07fc4fb1530a4424c6508729a9..8dc230d3b29e98a8286ef2ee7de19294b6db2384 100644 (file)
@@ -1,3 +1,56 @@
+2006-10-30  Darin Adler  <darin@apple.com>
+
+        Reviewed by Anders.
+
+        - remove BrowserExtension
+
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/kjs_window.cpp:
+        (KJS::createNewWindow):
+        (KJS::WindowFunc::callAsFunction):
+        * bridge/BrowserExtension.h: Removed.
+        * bridge/mac/BrowserExtensionMac.h: Removed.
+        * bridge/mac/BrowserExtensionMac.mm: Removed.
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::FrameMac):
+        (WebCore::FrameMac::submitForm):
+        (WebCore::FrameMac::urlSelected):
+        * bridge/win/BrowserExtensionWin.cpp: Removed.
+        * bridge/win/BrowserExtensionWin.h: Removed.
+        * bridge/win/FrameWin.cpp:
+        (WebCore::FrameWin::FrameWin):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::createWindow):
+        * loader/FrameLoader.h:
+        * loader/icon/IconLoader.cpp:
+        * loader/mac/FrameLoaderMac.mm:
+        (WebCore::FrameLoader::safeLoad):
+        (WebCore::FrameLoader::load):
+        (WebCore::FrameLoader::createWindow):
+        * page/Frame.cpp:
+        (WebCore::Frame::urlSelected):
+        (WebCore::Frame::requestFrame):
+        (WebCore::Frame::submitForm):
+        (WebCore::Frame::scheduleHistoryNavigation):
+        (WebCore::Frame::redirectionTimerFired):
+        * page/Frame.h:
+        * page/FrameLoadRequest.h:
+        (WebCore::FrameLoadRequest::FrameLoadRequest):
+        (WebCore::FrameLoadRequest::isEmpty):
+        (WebCore::FrameLoadRequest::resourceRequest):
+        (WebCore::FrameLoadRequest::frameName):
+        (WebCore::FrameLoadRequest::setFrameName):
+        * page/FramePrivate.h:
+        (WebCore::FramePrivate::FramePrivate):
+        (WebCore::FramePrivate::~FramePrivate):
+        * platform/gdk/BrowserExtensionGdk.h: Removed.
+        * platform/gdk/FrameGdk.cpp:
+        (WebCore::FrameGdk::FrameGdk):
+        * platform/gdk/TemporaryLinkStubs.cpp:
+        * platform/network/ResourceRequest.h:
+        (WebCore::ResourceRequest::isEmpty):
+
 2006-10-31  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Oliver.
index fab81ba8c36fcb2a97c49f457b57890aa11d86c8..b69c70a4cca995c36940630356efee833b28e19c 100644 (file)
                                RelativePath="..\..\bridge\AXObjectCache.h"
                                >
                        </File>
-                       <File
-                               RelativePath="..\..\bridge\BrowserExtension.h"
-                               >
-                       </File>
                        <File
                                RelativePath="..\..\bridge\History.h"
                                >
                        <Filter
                                Name="win"
                                >
-                               <File
-                                       RelativePath="..\..\bridge\win\BrowserExtensionWin.cpp"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\bridge\win\BrowserExtensionWin.h"
-                                       >
-                               </File>
                                <File
                                        RelativePath="..\..\bridge\win\FrameWin.cpp"
                                        >
index 4b87247b3d80ce4818a8b7c2c0ad60f794764634..9f8bed84eecdaaf84392f1a327116e88f46fd714 100644 (file)
                BCEA488C097D93020094C9E4 /* RenderText.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA484D097D93020094C9E4 /* RenderText.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCEA488D097D93020094C9E4 /* RenderTextFragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA484E097D93020094C9E4 /* RenderTextFragment.cpp */; };
                BCEA488E097D93020094C9E4 /* RenderTextFragment.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA484F097D93020094C9E4 /* RenderTextFragment.h */; };
-               BCEA4944097F0F5C0094C9E4 /* BrowserExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4943097F0F5C0094C9E4 /* BrowserExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BCEA4947097F0F770094C9E4 /* BrowserExtensionMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4945097F0F770094C9E4 /* BrowserExtensionMac.h */; };
-               BCEA4948097F0F770094C9E4 /* BrowserExtensionMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4946097F0F770094C9E4 /* BrowserExtensionMac.mm */; };
                BCEB377309B7BA3900CB38B1 /* FontMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCEB377209B7BA3900CB38B1 /* FontMac.mm */; };
                BCEB377609B7BB0D00CB38B1 /* FontFallbackList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEB377509B7BB0D00CB38B1 /* FontFallbackList.h */; };
                BCEF3434087B563E00BBF833 /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEF3432087B563E00BBF833 /* HTMLElementFactory.cpp */; };
                BCEA484D097D93020094C9E4 /* RenderText.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderText.h; sourceTree = "<group>"; };
                BCEA484E097D93020094C9E4 /* RenderTextFragment.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextFragment.cpp; sourceTree = "<group>"; };
                BCEA484F097D93020094C9E4 /* RenderTextFragment.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTextFragment.h; sourceTree = "<group>"; };
-               BCEA4943097F0F5C0094C9E4 /* BrowserExtension.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BrowserExtension.h; sourceTree = "<group>"; };
-               BCEA4945097F0F770094C9E4 /* BrowserExtensionMac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BrowserExtensionMac.h; sourceTree = "<group>"; };
-               BCEA4946097F0F770094C9E4 /* BrowserExtensionMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = BrowserExtensionMac.mm; sourceTree = "<group>"; };
                BCEB377209B7BA3900CB38B1 /* FontMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FontMac.mm; sourceTree = "<group>"; };
                BCEB377509B7BB0D00CB38B1 /* FontFallbackList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontFallbackList.h; sourceTree = "<group>"; };
                BCEF3432087B563E00BBF833 /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                        children = (
                                65BF02350974819000C43196 /* mac */,
                                55998A5C052B59CC0017A6C1 /* AXObjectCache.h */,
-                               BCEA4943097F0F5C0094C9E4 /* BrowserExtension.h */,
                                4B3043B50AE0363200A82647 /* EditorClient.h */,
                                935C475C09AC4CA000A6AAB4 /* History.h */,
                                14FD6DFC0AE5EA1B00AD67AD /* WindowFeatures.h */,
                        isa = PBXGroup;
                        children = (
                                55998A5D052B59CC0017A6C1 /* AXObjectCacheMac.mm */,
-                               BCEA4945097F0F770094C9E4 /* BrowserExtensionMac.h */,
-                               BCEA4946097F0F770094C9E4 /* BrowserExtensionMac.mm */,
                                65BF023B0974819000C43196 /* FrameMac.h */,
                                65BF023C0974819000C43196 /* FrameMac.mm */,
                                9380F68609A143B2001FDB34 /* FrameViewMac.mm */,
                                BCEA488A097D93020094C9E4 /* RenderTheme.h in Headers */,
                                BCEA488C097D93020094C9E4 /* RenderText.h in Headers */,
                                BCEA488E097D93020094C9E4 /* RenderTextFragment.h in Headers */,
-                               BCEA4944097F0F5C0094C9E4 /* BrowserExtension.h in Headers */,
-                               BCEA4947097F0F770094C9E4 /* BrowserExtensionMac.h in Headers */,
                                AB67D1A9097F3AE300F9392E /* RenderTextControl.h in Headers */,
                                A8DF3FCE097FA0FC0052981B /* HTMLFormCollection.h in Headers */,
                                A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */,
                                BCEA488B097D93020094C9E4 /* RenderText.cpp in Sources */,
                                BCEA488D097D93020094C9E4 /* RenderTextFragment.cpp in Sources */,
                                65FEA86909833ADE00BED4AB /* Page.cpp in Sources */,
-                               BCEA4948097F0F770094C9E4 /* BrowserExtensionMac.mm in Sources */,
                                AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */,
                                A8DF3FCF097FA0FC0052981B /* HTMLFormCollection.cpp in Sources */,
                                A8DF3FD1097FA0FC0052981B /* HTMLCollection.cpp in Sources */,
index a55e16609b8fcb7776b96ff0bb73e2756ea5b025..11d076f7ae449864277c78d9b8dbcffaea543dfc 100644 (file)
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "kjs_window.h"
 
-#include "BrowserExtension.h"
 #include "CString.h"
 #include "DOMWindow.h"
 #include "Element.h"
@@ -32,6 +31,7 @@
 #include "FloatRect.h"
 #include "Frame.h"
 #include "FrameLoadRequest.h"
+#include "FrameLoader.h"
 #include "FrameTree.h"
 #include "HTMLDocument.h"
 #include "JSCSSRule.h"
@@ -550,17 +550,16 @@ static float floatFeature(const HashMap<String, String> &features, const char *k
     return static_cast<int>(d);
 }
 
-static Frame *createNewWindow(ExecState *exec, Window *openerWindow, const DeprecatedString &URL,
-    const DeprecatedString &frameName, const WindowFeatures &windowFeatures, JSValue *dialogArgs)
+static Frame* createNewWindow(ExecState* exec, Window* openerWindow, const DeprecatedString &URL,
+    const String& frameName, const WindowFeatures& windowFeatures, JSValue* dialogArgs)
 {
-    Frame* openerPart = openerWindow->frame();
-    Frame* activePart = Window::retrieveActive(exec)->frame();
+    Frame* openerFrame = openerWindow->frame();
+    Frame* activeFrame = Window::retrieveActive(exec)->frame();
 
-    FrameLoadRequest frameRequest;
-    frameRequest.m_request = ResourceRequest(KURL(""));
-    frameRequest.m_frameName = frameName;
-    if (activePart)
-        frameRequest.m_request.setHTTPReferrer(activePart->referrer());
+    ResourceRequest request = ResourceRequest(KURL(""));
+    if (activeFrame)
+        request.setHTTPReferrer(activeFrame->referrer());
+    FrameLoadRequest frameRequest(request, frameName);
 
     // FIXME: It's much better for client API if a new window starts with a URL, here where we
     // know what URL we are going to open. Unfortunately, this code passes the empty string
@@ -569,25 +568,23 @@ static Frame *createNewWindow(ExecState *exec, Window *openerWindow, const Depre
     // do an isSafeScript call using the window we create, which can't be done before creating it.
     // We'd have to resolve all those issues to pass the URL instead of "".
 
-    Frame* newFrame = 0;
-    openerPart->browserExtension()->createNewWindow(frameRequest, windowFeatures, newFrame);
-
+    Frame* newFrame = openerFrame->loader()->createWindow(frameRequest, windowFeatures);
     if (!newFrame)
         return 0;
 
     Window* newWindow = Window::retrieveWindow(newFrame);
 
-    newFrame->setOpener(openerPart);
+    newFrame->setOpener(openerFrame);
     newFrame->setOpenedByJS(true);
     if (dialogArgs)
         newWindow->putDirect("dialogArguments", dialogArgs);
 
-    Document *activeDoc = activePart ? activePart->document() : 0;
+    Document *activeDoc = activeFrame ? activeFrame->document() : 0;
     if (!URL.isEmpty() && activeDoc) {
         DeprecatedString completedURL = activeDoc->completeURL(URL);
         if (!completedURL.startsWith("javascript:", false) || newWindow->isSafeScript(exec)) {
             bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-            newFrame->changeLocation(completedURL, activePart->referrer(), false, userGesture);
+            newFrame->changeLocation(completedURL, activeFrame->referrer(), false, userGesture);
         }
     }
 
@@ -1573,40 +1570,37 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
       
       // prepare arguments
       KURL url;
-      Frame* activePart = Window::retrieveActive(exec)->m_frame;
-      if (!str.isEmpty() && activePart)
-          url = activePart->document()->completeURL(str.deprecatedString());
-
-      FrameLoadRequest frameRequest;
-      frameRequest.m_request.setURL(url);
-      frameRequest.m_frameName = frameName.deprecatedString();
-      if (frameRequest.m_frameName == "_top") {
+      Frame* activeFrame = Window::retrieveActive(exec)->m_frame;
+      if (!str.isEmpty() && activeFrame)
+          url = activeFrame->document()->completeURL(str.deprecatedString());
+
+      FrameLoadRequest frameRequest(ResourceRequest(url), frameName);
+      if (frameRequest.frameName() == "_top") {
           while (frame->tree()->parent())
               frame = frame->tree()->parent();
           
           const Window* window = Window::retrieveWindow(frame);
           if (!url.url().startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
               bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-              frame->scheduleLocationChange(url.url(), activePart->referrer(), false/*don't lock history*/, userGesture);
+              frame->scheduleLocationChange(url.url(), activeFrame->referrer(), false/*don't lock history*/, userGesture);
           }
           return Window::retrieve(frame);
       }
-      if (frameRequest.m_frameName == "_parent") {
+      if (frameRequest.frameName() == "_parent") {
           if (frame->tree()->parent())
               frame = frame->tree()->parent();
           
           const Window* window = Window::retrieveWindow(frame);
           if (!url.url().startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
               bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-              frame->scheduleLocationChange(url.url(), activePart->referrer(), false/*don't lock history*/, userGesture);
+              frame->scheduleLocationChange(url.url(), activeFrame->referrer(), false/*don't lock history*/, userGesture);
           }
           return Window::retrieve(frame);
       }
       
       // request window (new or existing if framename is set)
-      Frame* newFrame = 0;
-      frameRequest.m_request.setHTTPReferrer(activePart->referrer());
-      frame->browserExtension()->createNewWindow(frameRequest, windowFeatures, newFrame);
+      frameRequest.resourceRequest().setHTTPReferrer(activeFrame->referrer());
+      Frame* newFrame = frame->loader()->createWindow(frameRequest, windowFeatures);
       if (!newFrame)
           return jsUndefined();
       newFrame->setOpener(frame);
@@ -1629,7 +1623,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
           const Window* window = Window::retrieveWindow(newFrame);
           if (!url.url().startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
               bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-              newFrame->scheduleLocationChange(url.url(), activePart->referrer(), false, userGesture);
+              newFrame->scheduleLocationChange(url.url(), activeFrame->referrer(), false, userGesture);
           }
       }
       return Window::retrieve(newFrame); // global object
diff --git a/WebCore/bridge/BrowserExtension.h b/WebCore/bridge/BrowserExtension.h
deleted file mode 100644 (file)
index a8b0db6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. 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. 
- */
-
-#ifndef BrowserExtension_h
-#define BrowserExtension_h
-
-namespace WebCore {
-
-class Frame;
-class FrameLoadRequest;
-class KURL;
-struct WindowFeatures;
-
-class BrowserExtension {
-public:
-    virtual ~BrowserExtension() { }
-    virtual void createNewWindow(const FrameLoadRequest&, const WindowFeatures&, Frame*& newFrame) = 0;
-protected:
-    BrowserExtension() {}
-};
-
-} // namespace WebCore
-
-#endif // BrowserExtension_h
diff --git a/WebCore/bridge/mac/BrowserExtensionMac.h b/WebCore/bridge/mac/BrowserExtensionMac.h
deleted file mode 100644 (file)
index c9dc2e1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. 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 "BrowserExtension.h"
-
-namespace WebCore {
-
-class Frame;
-class FrameMac;
-
-class BrowserExtensionMac : public BrowserExtension {
-public:
-    BrowserExtensionMac(Frame*);
-    virtual void createNewWindow(const FrameLoadRequest&, const WindowFeatures&, Frame*& newFrame);
-private:
-     FrameMac* m_frame;
-};
-
-}
diff --git a/WebCore/bridge/mac/BrowserExtensionMac.mm b/WebCore/bridge/mac/BrowserExtensionMac.mm
deleted file mode 100644 (file)
index 5218630..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. 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. 
- */
-
-#import "config.h"
-#import "BrowserExtensionMac.h"
-
-#import "BlockExceptions.h"
-#import "FloatRect.h"
-#import "FrameLoader.h"
-#import "FrameLoadRequest.h"
-#import "FrameMac.h"
-#import "FrameTree.h"
-#import "KURL.h"
-#import "Page.h"
-#import "Screen.h"
-#import "WebCoreFrameBridge.h"
-#import "WebCorePageBridge.h"
-#import "WindowFeatures.h"
-
-namespace WebCore {
-
-BrowserExtensionMac::BrowserExtensionMac(Frame *frame)
-    : m_frame(Mac(frame))
-{
-}
-
-void BrowserExtensionMac::createNewWindow(const FrameLoadRequest& request, 
-                                          const WindowFeatures& windowFeatures, 
-                                          Frame*& newFrame)
-{ 
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
-    ASSERT(!windowFeatures.dialog || request.m_frameName.isEmpty());
-
-    newFrame = NULL;
-    
-    const KURL& url = request.m_request.url();
-
-    if (!request.m_frameName.isEmpty()) {
-        if (Frame* frame = m_frame->tree()->find(request.m_frameName)) {
-            if (!url.isEmpty())
-                frame->loader()->load(request, true, nil, 0, HashMap<String, String>());
-            [Mac(frame)->bridge() activateWindow];
-            newFrame = frame;
-            return;
-        }
-    }
-    
-    WebCorePageBridge *pageBridge;
-    if (windowFeatures.dialog)
-        pageBridge = [m_frame->page()->bridge() createModalDialogWithURL:url.getNSURL() referrer:m_frame->referrer()];
-    else
-        pageBridge = [m_frame->bridge() createWindowWithURL:url.getNSURL()];
-    if (!pageBridge)
-        return;
-    
-    WebCoreFrameBridge *frameBridge = [pageBridge mainFrame];
-    if ([frameBridge _frame])
-        [frameBridge _frame]->tree()->setName(AtomicString(request.m_frameName));
-    
-    newFrame = [frameBridge _frame];
-    
-    [frameBridge setToolbarsVisible:windowFeatures.toolBarVisible || windowFeatures.locationBarVisible];
-    [frameBridge setStatusbarVisible:windowFeatures.statusBarVisible];
-    [frameBridge setScrollbarsVisible:windowFeatures.scrollbarsVisible];
-    [frameBridge setWindowIsResizable:windowFeatures.resizable];
-    
-    NSRect windowRect = [pageBridge impl]->windowRect();
-    if (windowFeatures.xSet)
-      windowRect.origin.x = windowFeatures.x;
-    if (windowFeatures.ySet)
-      windowRect.origin.y = windowFeatures.y;
-    
-    // 'width' and 'height' specify the dimensions of the WebView, but we can only resize the window, 
-    // so we compute a WebView delta and apply it to the window.
-    NSRect webViewRect = [[pageBridge outerView] frame];
-    if (windowFeatures.widthSet)
-      windowRect.size.width += windowFeatures.width - webViewRect.size.width;
-    if (windowFeatures.heightSet)
-      windowRect.size.height += windowFeatures.height - webViewRect.size.height;
-    
-    [pageBridge impl]->setWindowRect(windowRect);
-    
-    [frameBridge showWindow];
-    
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-}
index 4c8913f3ed9c46f4390c48b0b85677bae262f989..472941705cc38ab565efeeeb020f59737696cc1c 100644 (file)
@@ -29,7 +29,6 @@
 #import "AXObjectCache.h"
 #import "BeforeUnloadEvent.h"
 #import "BlockExceptions.h"
-#import "BrowserExtensionMac.h"
 #import "CSSComputedStyleDeclaration.h"
 #import "Cache.h"
 #import "ClipboardEvent.h"
@@ -150,7 +149,6 @@ FrameMac::FrameMac(Page* page, Element* ownerElement, PassRefPtr<EditorClient> c
     , _windowScriptObject(0)
     , _windowScriptNPObject(0)
 {
-    d->m_extension = new BrowserExtensionMac(this);
 }
 
 FrameMac::~FrameMac()
@@ -182,7 +180,7 @@ void FrameMac::submitForm(const FrameLoadRequest& request)
     // FIXME: Frame targeting is only one of the ways the submission could end up doing something other
     // than replacing this frame's content, so this check is flawed. On the other hand, the check is hardly
     // needed any more now that we reset d->m_submittedFormURL on each mouse or key down event.
-    Frame* target = request.m_frameName.isEmpty() ? this : tree()->find(request.m_frameName);
+    Frame* target = request.frameName().isEmpty() ? this : tree()->find(request.frameName());
     bool willReplaceThisFrame = false;
     for (Frame* p = this; p; p = p->tree()->parent()) {
         if (p == target) {
@@ -191,9 +189,9 @@ void FrameMac::submitForm(const FrameLoadRequest& request)
         }
     }
     if (willReplaceThisFrame) {
-        if (d->m_submittedFormURL == request.m_request.url())
+        if (d->m_submittedFormURL == request.resourceRequest().url())
             return;
-        d->m_submittedFormURL = request.m_request.url();
+        d->m_submittedFormURL = request.resourceRequest().url();
     }
 
     loader()->load(request, true, _currentEvent,
@@ -207,8 +205,8 @@ void FrameMac::submitForm(const FrameLoadRequest& request)
 void FrameMac::urlSelected(const FrameLoadRequest& request, const Event* /*triggeringEvent*/)
 {
     FrameLoadRequest copy = request;
-    if (copy.m_request.httpReferrer().isEmpty())
-        copy.m_request.setHTTPReferrer(referrer());
+    if (copy.resourceRequest().httpReferrer().isEmpty())
+        copy.resourceRequest().setHTTPReferrer(referrer());
 
     // FIXME: How do we know that userGesture is always true?
     loader()->load(copy, true, _currentEvent, 0, HashMap<String, String>());
diff --git a/WebCore/bridge/win/BrowserExtensionWin.cpp b/WebCore/bridge/win/BrowserExtensionWin.cpp
deleted file mode 100644 (file)
index d6d6987..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. 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 "BrowserExtensionWin.h"
-
-#include "FrameLoadRequest.h"
-#include "FrameWin.h"
-#include <windows.h>
-
-namespace WebCore {
-
-#define notImplemented() do { \
-    char buf[256] = {0}; \
-    _snprintf(buf, sizeof(buf), "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); \
-    OutputDebugStringA(buf); \
-} while (0)
-
-
-BrowserExtensionWin::BrowserExtensionWin(FrameWin* frame)
-    : m_frame(frame)
-{
-}
-
-int BrowserExtensionWin::getHistoryLength()
-{
-    return 0;
-}
-
-bool BrowserExtensionWin::canRunModal()
-{
-    notImplemented();
-    return 0;
-}
-
-void BrowserExtensionWin::createNewWindow(const FrameLoadRequest& request, const WindowFeatures& features, Frame*& newFrame)
-{
-    m_frame->createNewWindow(request, features, newFrame);
-}
-
-bool BrowserExtensionWin::canRunModalNow()
-{
-    notImplemented();
-    return 0;
-}
-
-void BrowserExtensionWin::runModal()
-{
-    notImplemented();
-}
-
-void BrowserExtensionWin::goBackOrForward(int)
-{
-    notImplemented();
-}
-
-KURL BrowserExtensionWin::historyURL(int distance)
-{
-    notImplemented();
-    return KURL();
-}
-
-} // namespace WebCore
diff --git a/WebCore/bridge/win/BrowserExtensionWin.h b/WebCore/bridge/win/BrowserExtensionWin.h
deleted file mode 100644 (file)
index 5498ebe..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2005, 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. 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 "BrowserExtension.h"
-
-namespace WebCore {
-
-class Frame;
-class FrameWin;
-
-class BrowserExtensionWin : public BrowserExtension {
-public:
-    BrowserExtensionWin(FrameWin*);
-    virtual void createNewWindow(const FrameLoadRequest&, const WindowFeatures&, Frame*& newFrame);
-private:
-     FrameWin* m_frame;
-};
-
-} // namespace WebCore
index 8c6880ba6f1bfa69f8057c138e7f45478a5ffa71..9a26acbb149a01c62e3f4174397be05252098d3d 100644 (file)
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "FrameWin.h"
 
-#include "BrowserExtensionWin.h"
 #include "TextResourceDecoder.h"
 #include "Document.h"
 #include "FrameLoadRequest.h"
@@ -45,7 +44,6 @@ FrameWin::FrameWin(Page* page, Element* ownerElement, FrameWinClient* client)
     : Frame(page, ownerElement)
     , m_client(client)
 {
-    d->m_extension = new BrowserExtensionWin(this);
     Settings* settings = new Settings();
     settings->setAutoLoadImages(true);
     settings->setMediumFixedFontSize(13);
index 554eaf63af76cabdc2ac4c02f5ee5d1f1223cf03..6313d18a02a9e584a9054694510c7562723ecaaa 100644 (file)
@@ -76,4 +76,11 @@ void FrameLoader::setDefersLoading(bool defers)
     m_client->setDefersLoading(defers);
 }
 
+#if !PLATFORM(MAC)
+Frame* FrameLoader::createWindow(const FrameLoadRequest&, const WindowFeatures&)
+{
+    return 0;
+}
+#endif
+
 }
index c31fee43210df6cc3acc9ddd8d31f5084c67cc1c..9b1e232e25666953e9f73d1913a0136c8f476117 100644 (file)
@@ -78,14 +78,15 @@ namespace WebCore {
     class Frame;
     class FrameLoadRequest;
     class FrameLoaderClient;
-    class PageState;
     class KURL;
     class MainResourceLoader;
+    class PageState;
+    class ResourceLoader;
     class ResourceRequest;
     class ResourceResponse;
     class String;
     class SubresourceLoader;
-    class ResourceLoader;
+    class WindowFeatures;
 
     typedef HashSet<RefPtr<ResourceLoader> > ResourceLoaderSet;
 
@@ -159,6 +160,8 @@ namespace WebCore {
         bool canLoad(NSURL *, const String& referrer, bool& hideReferrer);
 #endif
 
+        Frame* createWindow(const FrameLoadRequest&, const WindowFeatures&);
+
         void loadResourceSynchronously(const ResourceRequest& request, Vector<char>& data, ResourceResponse& r);
 
         // Also not cool.
index 376c3da587cb727b1f2d00d312a49c1f33f1c9ec..de6e5580f22f0daf5df6251f4026df4b4bc51a7b 100644 (file)
 #include "config.h"
 #include "IconLoader.h"
 
-#include "dom/Document.h"
-#include "loader/icon/IconDatabase.h"
+#include "Document.h"
+#include "Frame.h"
+#include "IconDatabase.h"
 #include "Logging.h"
-#include "page/Frame.h"
 #include "ResourceResponse.h"
 
 #if PLATFORM(MAC)
index be3ef3c38335e5e2077c9628ae576697c2b8c292..b31648d4e6251fbfb40c8bd4177f947d1d958a3e 100644 (file)
@@ -34,6 +34,7 @@
 #import "Document.h"
 #import "DocumentLoader.h"
 #import "Element.h"
+#import "FloatRect.h"
 #import "FormDataStream.h"
 #import "FormState.h"
 #import "FrameLoadRequest.h"
 #import "SubresourceLoader.h"
 #import "WebCoreFrameBridge.h"
 #import "WebCoreIconDatabaseBridge.h"
+#import "WebCorePageBridge.h"
 #import "WebCorePageState.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
+#import "WindowFeatures.h"
 #import <kjs/JSLock.h>
 #import <wtf/Assertions.h>
 
@@ -137,8 +140,8 @@ void FrameLoader::safeLoad(NSURL *URL)
 {
     // Call to the Frame because this is where our security checks are made.
     FrameLoadRequest request;
-    request.m_request.setURL(URL);
-    request.m_request.setHTTPReferrer(urlOriginalDataAsString([m_documentLoader->request() URL]));
+    request.resourceRequest().setURL(URL);
+    request.resourceRequest().setHTTPReferrer(urlOriginalDataAsString([m_documentLoader->request() URL]));
     load(request, true, [NSApp currentEvent], 0, HashMap<String, String>());
 }
 
@@ -146,36 +149,36 @@ void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, NSEven
     Element* submitForm, const HashMap<String, String>& formValues)
 {
     String referrer;
-    String argsReferrer = request.m_request.httpReferrer();
+    String argsReferrer = request.resourceRequest().httpReferrer();
     if (!argsReferrer.isEmpty())
         referrer = argsReferrer;
     else
         referrer = m_frame->referrer();
  
     bool hideReferrer;
-    if (!canLoad(request.m_request.url().getNSURL(), referrer, hideReferrer))
+    if (!canLoad(request.resourceRequest().url().getNSURL(), referrer, hideReferrer))
         return;
     if (hideReferrer)
         referrer = String();
     
-    Frame* targetFrame = m_frame->tree()->find(request.m_frameName);
+    Frame* targetFrame = m_frame->tree()->find(request.frameName());
     if (!canTarget(targetFrame))
         return;
         
-    if (request.m_request.httpMethod() != "POST") {
+    if (request.resourceRequest().httpMethod() != "POST") {
         FrameLoadType loadType;
-        if (request.m_request.cachePolicy() == ReloadIgnoringCacheData)
+        if (request.resourceRequest().cachePolicy() == ReloadIgnoringCacheData)
             loadType = FrameLoadTypeReload;
         else if (!userGesture)
             loadType = FrameLoadTypeInternal;
         else
             loadType = FrameLoadTypeStandard;    
     
-        load(request.m_request.url().getNSURL(), referrer, loadType, 
-            (request.m_frameName.length() ? (NSString *)request.m_frameName : nil), triggeringEvent, submitForm, formValues);
+        load(request.resourceRequest().url().getNSURL(), referrer, loadType, 
+            (!request.frameName().isEmpty() ? (NSString *)request.frameName() : nil), triggeringEvent, submitForm, formValues);
     } else
-        post(request.m_request.url().getNSURL(), referrer, (request.m_frameName.length() ? (NSString *)request.m_frameName : nil), 
-            request.m_request.httpBody(), request.m_request.httpContentType(), triggeringEvent, submitForm, formValues);
+        post(request.resourceRequest().url().getNSURL(), referrer, (!request.frameName().isEmpty() ? (NSString *)request.frameName() : nil), 
+            request.resourceRequest().httpBody(), request.resourceRequest().httpContentType(), triggeringEvent, submitForm, formValues);
 
     if (targetFrame && targetFrame != m_frame)
         [Mac(targetFrame)->bridge() activateWindow];
@@ -381,6 +384,55 @@ bool FrameLoader::canTarget(Frame* target) const
     return equalIgnoringCase(parentDomain, domain);
 }
 
+Frame* FrameLoader::createWindow(const FrameLoadRequest& request, const WindowFeatures& features)
+{ 
+    ASSERT(!features.dialog || request.frameName().isEmpty());
+
+    if (!request.frameName().isEmpty())
+        if (Frame* frame = m_frame->tree()->find(request.frameName())) {
+            if (!request.resourceRequest().url().isEmpty())
+                frame->loader()->load(request, true, nil, 0, HashMap<String, String>());
+            [Mac(frame)->bridge() activateWindow];
+            return frame;
+        }
+
+    WebCorePageBridge *pageBridge;
+    if (features.dialog)
+        pageBridge = [m_frame->page()->bridge() createModalDialogWithURL:request.resourceRequest().url().getNSURL() referrer:m_frame->referrer()];
+    else
+        pageBridge = [Mac(m_frame)->bridge() createWindowWithURL:request.resourceRequest().url().getNSURL()];
+    if (!pageBridge)
+        return 0;
+
+    Page* page = [pageBridge impl];
+    Frame* frame = page->mainFrame();
+    frame->tree()->setName(request.frameName());
+
+    [Mac(frame)->bridge() setToolbarsVisible:features.toolBarVisible || features.locationBarVisible];
+    [Mac(frame)->bridge() setStatusbarVisible:features.statusBarVisible];
+    [Mac(frame)->bridge() setScrollbarsVisible:features.scrollbarsVisible];
+    [Mac(frame)->bridge() setWindowIsResizable:features.resizable];
+
+    // The width and 'height parameters specify the dimensions of the view, but we can only resize
+    // the window, so adjust for the difference between the window size and the view size.
+
+    FloatRect windowRect = page->windowRect();
+    IntSize frameViewSize = frame->view()->size();
+    if (features.xSet)
+        windowRect.setX(features.x);
+    if (features.ySet)
+        windowRect.setY(features.y);
+    if (features.widthSet)
+        windowRect.setWidth(features.width + (windowRect.width() - frameViewSize.width()));
+    if (features.heightSet)
+        windowRect.setHeight(features.height + (windowRect.height() - frameViewSize.height()));
+    page->setWindowRect(windowRect);
+
+    [Mac(frame)->bridge() showWindow];
+
+    return frame;
+}
+
 bool FrameLoader::startLoadingMainResource(NSMutableURLRequest *request, id identifier)
 {
     ASSERT(!m_mainResourceLoader);
index 60e494bcc8b9d02a812b60ebddc10570e2daf48c..b7cd0c33ffbd498aa468bb010360cf0517dcb871 100644 (file)
@@ -37,7 +37,6 @@
 #include "CachedCSSStyleSheet.h"
 #include "DOMImplementation.h"
 #include "DOMWindow.h"
-#include "TextResourceDecoder.h"
 #include "DocLoader.h"
 #include "DocumentType.h"
 #include "EditingText.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTMLViewSourceDocument.h"
+#include "HitTestResult.h"
+#include "IconDatabase.h"
+#include "IconLoader.h"
 #include "ImageDocument.h"
 #include "IndentOutdentCommand.h"
-#include "loader/icon/IconDatabase.h"
-#include "loader/icon/IconLoader.h"
 #include "MediaFeatureNames.h"
 #include "MouseEventWithHitTestResults.h"
-#include "HitTestResult.h"
 #include "NodeList.h"
 #include "Page.h"
 #include "PlatformScrollBar.h"
@@ -76,6 +75,7 @@
 #include "SegmentedString.h"
 #include "TextDocument.h"
 #include "TextIterator.h"
+#include "TextResourceDecoder.h"
 #include "TypingCommand.h"
 #include "XMLTokenizer.h"
 #include "cssstyleselector.h"
@@ -279,15 +279,13 @@ void Frame::urlSelected(const ResourceRequest& request, const String& _target, c
     // ### ERROR HANDLING
     return;
 
-  FrameLoadRequest frameRequest;
-  frameRequest.m_request = request;
-  frameRequest.m_frameName = target;
+  FrameLoadRequest frameRequest(request, target);
 
   if (d->m_bHTTPRefresh)
     d->m_bHTTPRefresh = false;
 
-  if (frameRequest.m_request.httpReferrer().isEmpty())
-      frameRequest.m_request.setHTTPReferrer(d->m_referrer);
+  if (frameRequest.resourceRequest().httpReferrer().isEmpty())
+      frameRequest.resourceRequest().setHTTPReferrer(d->m_referrer);
 
   urlSelected(frameRequest, triggeringEvent);
 }
@@ -306,11 +304,9 @@ bool Frame::requestFrame(Element* ownerElement, const String& urlParam, const At
 
     Frame* frame = tree()->child(frameName);
     if (frame) {
-        ResourceRequestCachePolicy policy = (d->m_cachePolicy == CachePolicyReload) || (d->m_cachePolicy == CachePolicyRefresh) ? ReloadIgnoringCacheData : UseProtocolCachePolicy;
-        ResourceRequest request(url, d->m_referrer, policy);
-        FrameLoadRequest frameRequest;
-        frameRequest.m_request = request;
-        frame->urlSelected(frameRequest, 0);
+        ResourceRequestCachePolicy policy = (d->m_cachePolicy == CachePolicyReload) || (d->m_cachePolicy == CachePolicyRefresh)
+            ? ReloadIgnoringCacheData : UseProtocolCachePolicy;
+        frame->urlSelected(ResourceRequest(url, d->m_referrer, policy), 0);
     } else
         frame = loadSubframe(ownerElement, url, frameName, d->m_referrer);
     
@@ -382,9 +378,9 @@ void Frame::submitForm(const char *action, const String& url, const FormData& fo
   FrameLoadRequest frameRequest;
 
   if (!d->m_referrer.isEmpty())
-      frameRequest.m_request.setHTTPReferrer(d->m_referrer);
+      frameRequest.resourceRequest().setHTTPReferrer(d->m_referrer);
 
-  frameRequest.m_frameName = _target.isEmpty() ? d->m_doc->baseTarget() : _target ;
+  frameRequest.setFrameName(_target.isEmpty() ? d->m_doc->baseTarget() : _target);
 
   // Handle mailto: forms
   if (u.protocol() == "mailto") {
@@ -415,14 +411,14 @@ void Frame::submitForm(const char *action, const String& url, const FormData& fo
     if (u.protocol() != "mailto")
        u.setQuery(formData.flattenToString().deprecatedString());
   } else {
-      frameRequest.m_request.setHTTPBody(formData);
-      frameRequest.m_request.setHTTPMethod("POST");
+      frameRequest.resourceRequest().setHTTPBody(formData);
+      frameRequest.resourceRequest().setHTTPMethod("POST");
 
     // construct some user headers if necessary
     if (contentType.isNull() || contentType == "application/x-www-form-urlencoded")
-      frameRequest.m_request.setHTTPContentType(contentType);
+      frameRequest.resourceRequest().setHTTPContentType(contentType);
     else // contentType must be "multipart/form-data"
-      frameRequest.m_request.setHTTPContentType(contentType + "; boundary=" + boundary);
+      frameRequest.resourceRequest().setHTTPContentType(contentType + "; boundary=" + boundary);
   }
 
   if (d->m_runningScripts > 0) {
@@ -436,7 +432,7 @@ void Frame::submitForm(const char *action, const String& url, const FormData& fo
     d->m_submitForm->submitContentType = contentType;
     d->m_submitForm->submitBoundary = boundary;
   } else {
-      frameRequest.m_request.setURL(u);
+      frameRequest.resourceRequest().setURL(u);
       submitForm(frameRequest);
   }
 }
@@ -606,11 +602,6 @@ void Frame::didExplicitOpen()
   d->m_url = d->m_doc->URL();
 }
 
-BrowserExtension *Frame::browserExtension() const
-{
-  return d->m_extension;
-}
-
 FrameView* Frame::view() const
 {
     return d->m_view.get();
@@ -1287,13 +1278,9 @@ void Frame::scheduleHistoryNavigation(int steps)
 
     // If the URL we're going to navigate to is the same as the current one, except for the
     // fragment part, we don't need to schedule the navigation.
-    if (d->m_extension) {
-        KURL u = historyURL(steps);
-        
-        if (equalIgnoringRef(d->m_url, u)) {
-            goBackOrForward(steps);
-            return;
-        }
+    if (equalIgnoringRef(d->m_url, historyURL(steps))) {
+        goBackOrForward(steps);
+        return;
     }
     
     d->m_scheduledRedirection = historyNavigationScheduled;
@@ -1317,11 +1304,8 @@ void Frame::redirectionTimerFired(Timer<Frame>*)
         // in Konqueror...
         if (d->m_scheduledHistoryNavigationSteps == 0)
             urlSelected(url(), "", 0);
-        else {
-            if (d->m_extension) {
-                goBackOrForward(d->m_scheduledHistoryNavigationSteps);
-            }
-        }
+        else
+            goBackOrForward(d->m_scheduledHistoryNavigationSteps);
         return;
     }
 
index d17608801a7a95352336c72b8bec67a6eb8b31ab..5fd4a8e9e1ab30009ab993b6afe2df3ea82d75a1 100644 (file)
@@ -53,7 +53,6 @@ namespace KJS {
 
 namespace WebCore {
 
-class BrowserExtension;
 class CommandByName;
 class CSSComputedStyleDeclaration;
 class CSSMutableStyleDeclaration;
@@ -139,16 +138,7 @@ public:
   Page* page() const;
   void pageDestroyed();
   
-  /**
-   * Returns a pointer to the @ref BrowserExtension.
-   */
-  BrowserExtension* browserExtension() const;
-
-  /**
-   * Returns a pointer to the HTML document's view.
-   */
   FrameView* view() const;
-
   virtual void setView(FrameView*);
 
   /**
index d4fe76272cf3ad63c6af66bab154490208ed48af..4a592f0c1ec35453a819d164400fc97f5845688d 100644 (file)
 
 #include "ResourceRequest.h"
 
-
 namespace WebCore {
 
     struct FrameLoadRequest {
     public:
-        FrameLoadRequest() : m_lockHistory(false) { }
-        ResourceRequest m_request;
-        String m_frameName;
+        FrameLoadRequest()
+            : m_lockHistory(false)
+        {
+        }
+
+        FrameLoadRequest(const ResourceRequest& resourceRequest)
+            : m_resourceRequest(resourceRequest)
+            , m_lockHistory(false)
+        {
+        }
+
+        FrameLoadRequest(const ResourceRequest& resourceRequest, const String& frameName)
+            : m_resourceRequest(resourceRequest)
+            , m_frameName(frameName)
+            , m_lockHistory(false)
+        {
+        }
+
+        bool isEmpty() const { return m_resourceRequest.isEmpty(); }
+
+        ResourceRequest& resourceRequest() { return m_resourceRequest; }
+        const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
+
+        const String& frameName() const { return m_frameName; }
+        void setFrameName(const String& frameName) { m_frameName = frameName; }
+
         bool lockHistory() const { return m_lockHistory; }
         void setLockHistory(bool lock) { m_lockHistory = lock; }
 
     private:
+        ResourceRequest m_resourceRequest;
+        String m_frameName;
         bool m_lockHistory;
     };
 
index 7f6ef2bc713890ed78ef66711d68b3b6ee18181d..5069fb135ae5bdf045deecdb26e679d2209dde76 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef FramePrivate_h
 #define FramePrivate_h
 
-#include "BrowserExtension.h"
 #include "CSSMutableStyleDeclaration.h"
 #include "CachePolicy.h"
 #include "CommandByName.h"
@@ -66,7 +65,6 @@ namespace WebCore {
             : m_page(page)
             , m_treeNode(thisFrame, parent)
             , m_ownerElement(ownerElement)
-            , m_extension(0)
             , m_jscript(0)
             , m_runningScripts(0)
             , m_bJScriptEnabled(true)
@@ -122,7 +120,6 @@ namespace WebCore {
 
         ~FramePrivate()
         {
-            delete m_extension;
             delete m_jscript;
             delete m_loader;
             delete m_iconLoader;
@@ -136,7 +133,6 @@ namespace WebCore {
 
         Element* m_ownerElement;
         RefPtr<FrameView> m_view;
-        BrowserExtension* m_extension;
         RefPtr<Document> m_doc;
         RefPtr<TextResourceDecoder> m_decoder;
         String m_encoding;
diff --git a/WebCore/platform/gdk/BrowserExtensionGdk.h b/WebCore/platform/gdk/BrowserExtensionGdk.h
deleted file mode 100644 (file)
index e5bfb55..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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. 
- */
-
-#ifndef BrowserExtensionGdk_H_
-#define BrowserExtensionGdk_H_
-
-#include "BrowserExtension.h"
-
-namespace WebCore {
-
-class Frame;
-class FrameGdk;
-
-class BrowserExtensionGdk : public BrowserExtension {
-public:
-    BrowserExtensionGdk(Frame*);
-
-    virtual void createNewWindow(const FrameLoadRequest&);
-    virtual void createNewWindow(const FrameLoadRequest&, const WindowFeatures&, Frame*&);
-
-    virtual void setIconURL(const KURL&);
-    virtual void setTypedIconURL(const KURL&, const String& type);
-
-    virtual int getHistoryLength();
-    virtual void goBackOrForward(int distance);
-    virtual KURL historyURL(int distance);
-
-    virtual bool canRunModal();
-    virtual bool canRunModalNow();
-    virtual void runModal();
-
-private:
-    FrameGdk* m_frame;
-};
-
-}
-
-#endif
index 0b88762fb3350032147f56224282d3530cba18f3..854ab564c3db55df793166270620fe00252499c4 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "config.h"
 #include "FrameGdk.h"
+
 #include "Element.h"
 #include "RenderObject.h"
 #include "RenderWidget.h"
@@ -35,7 +36,6 @@
 #include "Document.h"
 #include "DOMWindow.h"
 #include "DOMImplementation.h"
-#include "BrowserExtensionGdk.h"
 #include "Document.h"
 #include "Settings.h"
 #include "Plugin.h"
@@ -159,7 +159,6 @@ static void doScroll(const RenderObject* r, float deltaX, float deltaY)
 FrameGdk::FrameGdk(GdkDrawable* gdkdrawable)
     : Frame(new Page, 0), m_drawable(gdkdrawable)
 {
-    d->m_extension = new BrowserExtensionGdk(this);
     Settings* settings = new Settings;
     settings->setAutoLoadImages(true);
     settings->setMinFontSize(5);
@@ -187,7 +186,6 @@ FrameGdk::FrameGdk(GdkDrawable* gdkdrawable)
 FrameGdk::FrameGdk(Page* page, Element* element)
     : Frame(page,element)
 {
-    d->m_extension = new BrowserExtensionGdk(this);
     Settings* settings = new Settings;
     settings->setAutoLoadImages(true);
     setSettings(settings);
index e578366d077db3ea9bbace1dd6556f2016fde893..f1b1fb2d00c8d66522e157e8c3bacc03935893b0 100644 (file)
@@ -55,7 +55,6 @@
 #include "PlugInInfoStore.h"
 #include "RenderTheme.h"
 #include "FrameGdk.h"
-#include "BrowserExtensionGdk.h"
 #include "FrameLoadRequest.h"
 #include "RenderThemeGdk.h"
 #include "TextBoundaries.h"
@@ -180,18 +179,6 @@ bool FrameGdk::isLoadTypeReload() { notImplemented(); return false; }
 KURL FrameGdk::originalRequestURL() const { return KURL(); }
 Plugin* FrameGdk::createPlugin(Element*, KURL const&, const Vector<String>&, const Vector<String>&, String const&) { notImplemented(); return 0; }
 
-bool BrowserExtensionGdk::canRunModal() { notImplemented(); return 0; }
-void BrowserExtensionGdk::createNewWindow(struct WebCore::FrameLoadRequest const&, struct WebCore::WindowFeatures const&, Frame*&) { notImplemented(); }
-void BrowserExtensionGdk::createNewWindow(struct WebCore::FrameLoadRequest const&) { notImplemented(); }
-bool BrowserExtensionGdk::canRunModalNow() { notImplemented(); return 0; }
-void BrowserExtensionGdk::runModal() { notImplemented(); }
-void BrowserExtensionGdk::goBackOrForward(int) { notImplemented(); }
-KURL BrowserExtensionGdk::historyURL(int distance) { notImplemented(); return KURL(); }
-BrowserExtensionGdk::BrowserExtensionGdk(WebCore::Frame*) { }
-void BrowserExtensionGdk::setTypedIconURL(KURL const&, const String&) { }
-void BrowserExtensionGdk::setIconURL(KURL const&) { }
-int BrowserExtensionGdk::getHistoryLength() { return 0; }
-
 int WebCore::screenDepthPerComponent(const Page*) { notImplemented(); return 0; }
 bool WebCore::screenIsMonochrome(const Page*) { notImplemented(); return false; }
 
index cefe7e74788594a7b97b7d670b49e96b5a729ecb..d240b656c4b0fa074b47a95f7dc6c56d59dcd716 100644 (file)
@@ -78,6 +78,8 @@ namespace WebCore {
         {
         }
 
+        bool isEmpty() const { return m_url.isEmpty(); }
+
         const KURL& url() const { return m_url; }
         void setURL(const KURL& url) { m_url = url; }