WebCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2006 23:56:59 +0000 (23:56 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2006 23:56:59 +0000 (23:56 +0000)
        Reviewed by Maciej, Anders, Darin.

        Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.
        Fixed a minor where WebCore would always assume it was displayed on the
        monitor containing the menubar. window.open and window.showModalDialog
        are now cross-platform.

        Layout tests, manual-tests/show-modal-dialog, and manual-tests/
        window-open-features-parsing all pass. I verified the new screen functionality
        by running in DRT, and checking whether WebCore knew it was off-screen.

        Some refactoring remains, as all were not pleased by this design. I see
        in my future another patch.

        * bindings/js/kjs_window.cpp: Screen is now a stand-alone object with a
        client, to encapsulate asking the platform questions about the screen occupied by
        the page. (Previously, we always assumed we were on screen 0, which was a bug.)
        * bridge/mac/WebCoreFrameBridge.mm:
        (createMouseEventFromDraggingInfo): Reversed argument order, to match other
        functions.
        (-[WebCoreFrameBridge dragSourceMovedTo:]): ditto
        (-[WebCoreFrameBridge dragSourceEndedAt:operation:]): ditto
        * bridge/mac/WebCoreFrameNamespaces.h: Removed. Dead Code.
        * bridge/mac/WebCoreFrameNamespaces.mm: Removed. Dead Code.
        * bridge/mac/WebCorePageBridge.h: Removed. Dead Code.
        * bridge/mac/WebCorePageBridge.mm: Removed. Dead Code.
        * manual-tests/window-open-features-parsing.html: Updated for accuracy.
        (In this case, neither size nor position is specified, so you should
        get the default window size and position.)
        * page/Screen.cpp: Added. Includes screen-related helper functions used
        in WebCore and WebKit.
        * platform/PlatformMouseEvent.h: Exported common code so it doesn't have
        to be duplicated. Renamed "position" to "point" since both were used,
        and "point" seemed clearer.
        * platform/Screen.h: Removed. Dead Code.
        * platform/mac/LoggingMac.mm: Added. Moved code here from WebCorePageBridge
        initialization.

WebKit:

        Reviewed by Maciej, Darin, Anders.

        Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.

        (WebChromeClient::pageRect): It may seem weird for the page to ask the Chrome/ChromeClient
        about its own dimensions. The idea here is that we're asking the Chrome how
        much space it has devoted to the page. We have API for this (-webViewContentRect), but
        it was documented incorrectly (even Safari used it wrong), so we don't use
        it anymore. Once we fix our API/documentation, we can return to making a
        delegate callback to ask for the page's size.
        (WebChromeClient::createWindow): Changed to take a FrameLoadRequest with
        an appropriate referrer, instead of making up its own.
        (WebChromeClient::createModalDialog): Changed to take a FrameLoadRequest with
        an appropriate referrer, instead of broken out parcels.
        * WebCoreSupport/WebPageBridge.h: Removed. Dead Code.
        * WebCoreSupport/WebPageBridge.mm: Removed. Dead Code.
        * WebCoreSupport/WebScreenClient.h: Added.
        * WebCoreSupport/WebScreenClient.mm: Added.
        * WebView/WebView.mm: Added NULL checks for new _private->page, since
        it's not NULL-safe like the bridge was, and it gets cleared before
        dealloc.

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

50 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_window.cpp
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/PageMac.mm [deleted file]
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/bridge/mac/WebCoreFrameNamespaces.h [deleted file]
WebCore/bridge/mac/WebCoreFrameNamespaces.mm [deleted file]
WebCore/bridge/mac/WebCorePageBridge.h [deleted file]
WebCore/css/MediaQueryEvaluator.cpp
WebCore/html/HTMLCanvasElement.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/mac/FrameLoaderMac.mm
WebCore/manual-tests/window-open-features-parsing.html
WebCore/page/Chrome.cpp
WebCore/page/Chrome.h
WebCore/page/ChromeClient.h
WebCore/page/DOMWindow.cpp
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/Page.cpp
WebCore/page/Page.h
WebCore/page/Screen.cpp [new file with mode: 0644]
WebCore/page/Screen.h [new file with mode: 0644]
WebCore/page/ScreenClient.h [moved from WebCore/platform/Screen.h with 71% similarity]
WebCore/platform/Logging.h
WebCore/platform/PlatformMouseEvent.h
WebCore/platform/mac/LoggingMac.mm [moved from WebCore/bridge/mac/WebCorePageBridge.mm with 67% similarity]
WebCore/platform/mac/PlatformMouseEventMac.mm
WebCore/platform/mac/ScreenMac.mm
WebCore/platform/mac/WheelEventMac.mm
WebCore/rendering/RenderObject.cpp
WebKit/ChangeLog
WebKit/WebCoreSupport/WebChromeClient.h
WebKit/WebCoreSupport/WebChromeClient.mm
WebKit/WebCoreSupport/WebFrameBridge.h
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/WebCoreSupport/WebPageBridge.h [deleted file]
WebKit/WebCoreSupport/WebPageBridge.mm [deleted file]
WebKit/WebCoreSupport/WebScreenClient.h [new file with mode: 0644]
WebKit/WebCoreSupport/WebScreenClient.mm [new file with mode: 0644]
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameInternal.h
WebKit/WebView/WebView.mm
WebKit/WebView/WebViewInternal.h

index 690e148..6ecb01b 100644 (file)
@@ -1,3 +1,43 @@
+2006-11-06  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej, Anders, Darin.
+
+        Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.
+        Fixed a minor where WebCore would always assume it was displayed on the 
+        monitor containing the menubar. window.open and window.showModalDialog 
+        are now cross-platform. 
+        
+        Layout tests, manual-tests/show-modal-dialog, and manual-tests/
+        window-open-features-parsing all pass. I verified the new screen functionality
+        by running in DRT, and checking whether WebCore knew it was off-screen.
+        
+        Some refactoring remains, as all were not pleased by this design. I see
+        in my future another patch.
+
+        * bindings/js/kjs_window.cpp: Screen is now a stand-alone object with a
+        client, to encapsulate asking the platform questions about the screen occupied by
+        the page. (Previously, we always assumed we were on screen 0, which was a bug.)
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (createMouseEventFromDraggingInfo): Reversed argument order, to match other
+        functions.
+        (-[WebCoreFrameBridge dragSourceMovedTo:]): ditto
+        (-[WebCoreFrameBridge dragSourceEndedAt:operation:]): ditto
+        * bridge/mac/WebCoreFrameNamespaces.h: Removed. Dead Code.
+        * bridge/mac/WebCoreFrameNamespaces.mm: Removed. Dead Code.
+        * bridge/mac/WebCorePageBridge.h: Removed. Dead Code.
+        * bridge/mac/WebCorePageBridge.mm: Removed. Dead Code.
+        * manual-tests/window-open-features-parsing.html: Updated for accuracy.
+        (In this case, neither size nor position is specified, so you should
+        get the default window size and position.)
+        * page/Screen.cpp: Added. Includes screen-related helper functions used
+        in WebCore and WebKit.
+        * platform/PlatformMouseEvent.h: Exported common code so it doesn't have
+        to be duplicated. Renamed "position" to "point" since both were used,
+        and "point" seemed clearer.
+        * platform/Screen.h: Removed. Dead Code.
+        * platform/mac/LoggingMac.mm: Added. Moved code here from WebCorePageBridge
+        initialization.
+
 2006-11-06  Graham Dennis  <graham.dennis@gmail.com>
 
         Reviewed by Tim Hatcher.
index abc0db5..6b237d0 100644 (file)
 .objc_class_name_WebCoreCache
 .objc_class_name_WebCoreEncodings
 .objc_class_name_WebCoreFrameBridge
-.objc_class_name_WebCoreFrameNamespaces
 .objc_class_name_WebCoreHistory
 .objc_class_name_WebCoreIconDatabaseBridge
 .objc_class_name_WebCoreJavaScript
 .objc_class_name_WebCoreKeyGenerator
-.objc_class_name_WebCorePageBridge
 .objc_class_name_WebCorePageState
 .objc_class_name_WebCoreScriptDebugger
 .objc_class_name_WebCoreSettings
@@ -161,11 +159,13 @@ __ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
 __ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
 __ZN7WebCore11selectRangeEPNS_19SelectionControllerEPNS_5RangeENS_9EAffinityEb
 __ZN7WebCore12AtomicString3addEPNS_10StringImplE
+__ZN7WebCore12nsURLRequestERKNS_15ResourceRequestE
 __ZN7WebCore13HitTestResultC1ERKNS_8IntPointE
 __ZN7WebCore13HitTestResultC1ERKS0_
 __ZN7WebCore13HitTestResultD1Ev
 __ZN7WebCore13HitTestResultaSERKS0_
 __ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
+__ZN7WebCore13scaleToScreenERKNS_9FloatRectEP8NSScreen
 __ZN7WebCore14DocumentLoader12setCommittedEb
 __ZN7WebCore14DocumentLoader13attachToFrameEv
 __ZN7WebCore14DocumentLoader15detachFromFrameEv
@@ -177,6 +177,8 @@ __ZN7WebCore14DocumentLoaderC2EP12NSURLRequest
 __ZN7WebCore14DocumentLoaderD2Ev
 __ZN7WebCore14RenderListItem17markerStringValueEv
 __ZN7WebCore14ResourceLoader14cancelledErrorEv
+__ZN7WebCore14flipScreenRectERK7_NSRectP8NSScreen
+__ZN7WebCore15scaleFromScreenERK7_NSRectP8NSScreen
 __ZN7WebCore16DeprecatedString6appendENS_14DeprecatedCharE
 __ZN7WebCore16DeprecatedString6appendERKS0_
 __ZN7WebCore16DeprecatedString6appendEc
@@ -195,9 +197,14 @@ __ZN7WebCore19SelectionController9selectAllEv
 __ZN7WebCore21PlatformKeyboardEventC1EP7NSEventb
 __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object
+__ZN7WebCore36InitializeLoggingChannelsIfNecessaryEv
 __ZN7WebCore4KURLC1EP5NSURL
 __ZN7WebCore4KURLC1ERKNS_16DeprecatedStringE
+__ZN7WebCore4Page12setGroupNameERKNS_6StringE
+__ZN7WebCore4Page12setMainFrameEN3WTF10PassRefPtrINS_5FrameEEE
 __ZN7WebCore4Page16setDefersLoadingEb
+__ZN7WebCore4PageC1EN3WTF10PassRefPtrINS_12ChromeClientEEENS2_INS_12ScreenClientEEE
+__ZN7WebCore4PageD1Ev
 __ZN7WebCore5Frame11clearTimersEv
 __ZN7WebCore5Frame11completeURLERKNS_16DeprecatedStringE
 __ZN7WebCore5Frame11setSettingsEPNS_8SettingsE
@@ -222,6 +229,7 @@ __ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
 __ZN7WebCore6StringC1EP8NSString
 __ZN7WebCore6StringC1EP8NSString
 __ZN7WebCore6StringC1EPKc
+__ZN7WebCore6screenEP8NSWindow
 __ZN7WebCore7nsColorERKNS_5ColorE
 __ZN7WebCore7nsColorERKNS_5ColorE
 __ZN7WebCore8Document11completeURLERKNS_16DeprecatedStringE
@@ -249,6 +257,8 @@ __ZN7WebCore8FrameMac9mouseDownEP7NSEvent
 __ZN7WebCore8IntPointC1ERK7CGPoint
 __ZN7WebCore8IntPointC1ERK8_NSPoint
 __ZN7WebCore8parseURLERKNS_6StringE
+__ZN7WebCore9FloatRect5scaleEf
+__ZN7WebCore9FloatRectC1ERK7_NSRect
 __ZN7WebCore9FrameTree11appendChildEN3WTF10PassRefPtrINS_5FrameEEE
 __ZN7WebCore9FrameTree7setNameERKNS_12AtomicStringE
 __ZN7WebCore9HTMLNames10listingTagE
index 8bb4e1f..2a04beb 100644 (file)
                066C773E0AB6053F00238CC4 /* IconMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 066C773D0AB6053F00238CC4 /* IconMac.mm */; };
                06E81ED70AB5D5E900C87837 /* LocalCurrentGraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */; };
                06E81EEC0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */; };
+               14025EB10AFD249E005919E2 /* Screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14025EAE0AFD249E005919E2 /* Screen.cpp */; };
+               14025EB20AFD249E005919E2 /* Screen.h in Headers */ = {isa = PBXBuildFile; fileRef = 14025EAF0AFD249E005919E2 /* Screen.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               14025EB30AFD249E005919E2 /* ScreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14025EB00AFD249E005919E2 /* ScreenClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1402645D0AFDC19B005919E2 /* LoggingMac.mm */; };
+               1402692D0AFE72D8005919E2 /* ScreenMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1402692C0AFE72D8005919E2 /* ScreenMac.mm */; };
                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403B99509EB13AF00797C7F /* DOMWindow.h */; };
                1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1403B99609EB13AF00797C7F /* DOMWindow.cpp */; };
                1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */; };
                51F11E150A48C2920034A24E /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F11E140A48C2920034A24E /* SQLTransaction.cpp */; };
                550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
                550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               650E3F690AF6C168001FA3AD /* ResourceRequestMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 650E3F670AF6C168001FA3AD /* ResourceRequestMac.h */; };
+               650E3F690AF6C168001FA3AD /* ResourceRequestMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 650E3F670AF6C168001FA3AD /* ResourceRequestMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                650E3F6A0AF6C168001FA3AD /* ResourceRequestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 650E3F680AF6C168001FA3AD /* ResourceRequestMac.mm */; };
                650F53DC09D15DDA00C9B0C8 /* CSSGrammar.h in Headers */ = {isa = PBXBuildFile; fileRef = 650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */; };
                650F53DD09D15DDF00C9B0C8 /* CSSGrammar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6565814409D13043000E61D7 /* CSSGrammar.cpp */; };
                6550B6A4099DF0270090D781 /* EditingText.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B69A099DF0270090D781 /* EditingText.h */; };
                6550B6A5099DF0270090D781 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6550B69B099DF0270090D781 /* Text.cpp */; };
                6550B6A6099DF0270090D781 /* Text.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B69C099DF0270090D781 /* Text.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               6552E7AA096AA11B0006F248 /* WebCoreFrameNamespaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 6552E7A8096AA11B0006F248 /* WebCoreFrameNamespaces.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               6552E7AB096AA11B0006F248 /* WebCoreFrameNamespaces.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6552E7A9096AA11B0006F248 /* WebCoreFrameNamespaces.mm */; };
                655A81BE0AEF67E6000975F0 /* HTTPHeaderMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 655A81BD0AEF67E6000975F0 /* HTTPHeaderMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6563A9A70ADF4094000ED2CD /* LoaderNSURLRequestExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 6563A9A50ADF4094000ED2CD /* LoaderNSURLRequestExtras.h */; };
                6563A9A80ADF4094000ED2CD /* LoaderNSURLRequestExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 6563A9A60ADF4094000ED2CD /* LoaderNSURLRequestExtras.m */; };
                6582A15D09999D6D00BEEB6D /* IntPointMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A14F09999D6D00BEEB6D /* IntPointMac.mm */; };
                6582A15E09999D6D00BEEB6D /* IntRectMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15009999D6D00BEEB6D /* IntRectMac.mm */; };
                6582A15F09999D6D00BEEB6D /* IntSizeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15109999D6D00BEEB6D /* IntSizeMac.mm */; };
-               6582A16209999D6D00BEEB6D /* ScreenMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15409999D6D00BEEB6D /* ScreenMac.mm */; };
                6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */; };
                6582A17809999EA000BEEB6D /* DeprecatedStringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A17709999EA000BEEB6D /* DeprecatedStringMac.mm */; };
-               658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 658436850AE01B7400E53753 /* FrameLoadRequest.h */; };
+               658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 658436850AE01B7400E53753 /* FrameLoadRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
                658821660AF4CDF700F01D1F /* ResourceResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 658821650AF4CDF700F01D1F /* ResourceResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6588216B0AF4CE1200F01D1F /* ResourceResponseMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 658821680AF4CE1200F01D1F /* ResourceResponseMac.h */; };
                6588216C0AF4CE1200F01D1F /* ResourceResponseMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 658821690AF4CE1200F01D1F /* ResourceResponseMac.mm */; };
                65BF02300974816300C43196 /* FramePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BF022B0974816300C43196 /* FramePrivate.h */; };
                65BF02440974819000C43196 /* FrameMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BF023B0974819000C43196 /* FrameMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65BF02450974819000C43196 /* FrameMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65BF023C0974819000C43196 /* FrameMac.mm */; };
-               65C7F4320979E2620022E453 /* WebCorePageBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C7F4310979E2620022E453 /* WebCorePageBridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               65C7F44C0979E8C90022E453 /* WebCorePageBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65C7F44B0979E8C90022E453 /* WebCorePageBridge.mm */; };
                65C97AF308EA908800ACD273 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C97AF208EA908800ACD273 /* config.h */; };
                65CBFEF90974F607001DAC25 /* FrameView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65CBFEF70974F607001DAC25 /* FrameView.cpp */; };
                65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */ = {isa = PBXBuildFile; fileRef = 65CBFEF80974F607001DAC25 /* FrameView.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9380F47409A11AB4001FDB34 /* Widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 9380F47209A11AB4001FDB34 /* Widget.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9380F47809A11ACC001FDB34 /* WidgetMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9380F47709A11ACC001FDB34 /* WidgetMac.mm */; };
                9380F68709A143B2001FDB34 /* FrameViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9380F68609A143B2001FDB34 /* FrameViewMac.mm */; };
-               9385F762098D9C3100D90D24 /* Screen.h in Headers */ = {isa = PBXBuildFile; fileRef = 9385F761098D9C3100D90D24 /* Screen.h */; };
                938E65F109F09840008A48EC /* JSHTMLElementWrapperFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */; };
                938E65F709F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */; };
                938E666009F09B81008A48EC /* JSHTMLCanvasElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938E665F09F09B81008A48EC /* JSHTMLCanvasElement.cpp */; };
                93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */; };
                93E22A6F0AF5E94100D48324 /* PageState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E22A6E0AF5E94100D48324 /* PageState.cpp */; };
                93E22A730AF5E94C00D48324 /* PageState.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E22A720AF5E94C00D48324 /* PageState.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               93E47C5C09BE2BBB0019C5C1 /* PageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */; };
                93E62D9B0985F41600E1B5E3 /* SystemTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E62D990985F41600E1B5E3 /* SystemTime.h */; };
                93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */; };
                93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A82398A609B3ACDB00B60641 /* PlugInInfoStore.h in Headers */ = {isa = PBXBuildFile; fileRef = A82398A509B3ACDB00B60641 /* PlugInInfoStore.h */; };
                A82398A809B3ACF500B60641 /* PlugInInfoStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */; };
                A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8239DFE09B3CF8A00B60641 /* Logging.cpp */; };
-               A8239E0109B3CF8A00B60641 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = A8239DFF09B3CF8A00B60641 /* Logging.h */; };
+               A8239E0109B3CF8A00B60641 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = A8239DFF09B3CF8A00B60641 /* Logging.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A826E8AE0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A826E8AC0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.h */; };
                A826EC480A1B0CBE00CD1BB6 /* JSHTMLOptionElementConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */; };
                A833C7CA0A2CF06B00D57664 /* SVGNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581E809D1508D000E61D7 /* SVGNames.cpp */; };
                066C773D0AB6053F00238CC4 /* IconMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IconMac.mm; sourceTree = "<group>"; };
                06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalCurrentGraphicsContext.h; sourceTree = "<group>"; };
                06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalCurrentGraphicsContext.mm; sourceTree = "<group>"; };
+               14025EAE0AFD249E005919E2 /* Screen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Screen.cpp; sourceTree = "<group>"; };
+               14025EAF0AFD249E005919E2 /* Screen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Screen.h; sourceTree = "<group>"; };
+               14025EB00AFD249E005919E2 /* ScreenClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScreenClient.h; sourceTree = "<group>"; };
+               1402645D0AFDC19B005919E2 /* LoggingMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingMac.mm; sourceTree = "<group>"; };
+               1402692C0AFE72D8005919E2 /* ScreenMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ScreenMac.mm; sourceTree = "<group>"; };
                1403B90C09EB124500797C7F /* DOMWindow.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindow.idl; sourceTree = "<group>"; };
                1403B99509EB13AF00797C7F /* DOMWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindow.h; sourceTree = "<group>"; };
                1403B99609EB13AF00797C7F /* DOMWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindow.cpp; sourceTree = "<group>"; };
                6550B69A099DF0270090D781 /* EditingText.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EditingText.h; sourceTree = "<group>"; };
                6550B69B099DF0270090D781 /* Text.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Text.cpp; sourceTree = "<group>"; };
                6550B69C099DF0270090D781 /* Text.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Text.h; sourceTree = "<group>"; };
-               6552E7A8096AA11B0006F248 /* WebCoreFrameNamespaces.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreFrameNamespaces.h; sourceTree = "<group>"; };
-               6552E7A9096AA11B0006F248 /* WebCoreFrameNamespaces.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFrameNamespaces.mm; sourceTree = "<group>"; };
                655A81BD0AEF67E6000975F0 /* HTTPHeaderMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderMap.h; sourceTree = "<group>"; };
                6563A9A50ADF4094000ED2CD /* LoaderNSURLRequestExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LoaderNSURLRequestExtras.h; sourceTree = "<group>"; };
                6563A9A60ADF4094000ED2CD /* LoaderNSURLRequestExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = LoaderNSURLRequestExtras.m; sourceTree = "<group>"; };
                6582A14F09999D6D00BEEB6D /* IntPointMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IntPointMac.mm; sourceTree = "<group>"; };
                6582A15009999D6D00BEEB6D /* IntRectMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IntRectMac.mm; sourceTree = "<group>"; };
                6582A15109999D6D00BEEB6D /* IntSizeMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IntSizeMac.mm; sourceTree = "<group>"; };
-               6582A15409999D6D00BEEB6D /* ScreenMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ScreenMac.mm; sourceTree = "<group>"; };
                6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SystemTimeMac.cpp; sourceTree = "<group>"; };
                6582A17709999EA000BEEB6D /* DeprecatedStringMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DeprecatedStringMac.mm; sourceTree = "<group>"; };
                658436850AE01B7400E53753 /* FrameLoadRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoadRequest.h; sourceTree = "<group>"; };
                65BF022B0974816300C43196 /* FramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FramePrivate.h; sourceTree = "<group>"; };
                65BF023B0974819000C43196 /* FrameMac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameMac.h; sourceTree = "<group>"; };
                65BF023C0974819000C43196 /* FrameMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameMac.mm; sourceTree = "<group>"; };
-               65C7F4310979E2620022E453 /* WebCorePageBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePageBridge.h; sourceTree = "<group>"; };
-               65C7F44B0979E8C90022E453 /* WebCorePageBridge.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCorePageBridge.mm; sourceTree = "<group>"; };
                65C97AF208EA908800ACD273 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                65CBFEF70974F607001DAC25 /* FrameView.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FrameView.cpp; sourceTree = "<group>"; };
                65CBFEF80974F607001DAC25 /* FrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameView.h; sourceTree = "<group>"; };
                9380F47209A11AB4001FDB34 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = "<group>"; };
                9380F47709A11ACC001FDB34 /* WidgetMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WidgetMac.mm; sourceTree = "<group>"; };
                9380F68609A143B2001FDB34 /* FrameViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameViewMac.mm; sourceTree = "<group>"; };
-               9385F761098D9C3100D90D24 /* Screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Screen.h; sourceTree = "<group>"; };
                938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLElementWrapperFactory.h; sourceTree = "<group>"; };
                938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLElementWrapperFactory.cpp; sourceTree = "<group>"; };
                938E662509F09956008A48EC /* HTMLCanvasElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLCanvasElement.idl; sourceTree = "<group>"; };
                93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoader.cpp; sourceTree = "<group>"; };
                93E22A6E0AF5E94100D48324 /* PageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageState.cpp; sourceTree = "<group>"; };
                93E22A720AF5E94C00D48324 /* PageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageState.h; sourceTree = "<group>"; };
-               93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PageMac.mm; sourceTree = "<group>"; };
                93E62D990985F41600E1B5E3 /* SystemTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemTime.h; sourceTree = "<group>"; };
                93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreSystemInterface.mm; sourceTree = "<group>"; };
                93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreSystemInterface.h; sourceTree = "<group>"; };
                                935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */,
                                6593923909AE435C002C531F /* KURLMac.mm */,
                                9352084409BD43B900F2038D /* Language.mm */,
-                               06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
                                06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */,
+                               06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
                                935207BF09BD412000F2038D /* LocalizedStringsMac.mm */,
+                               1402645D0AFDC19B005919E2 /* LoggingMac.mm */,
                                65F5382409B2B57500F3DC4A /* mac-encodings.txt */,
                                935C476F09AC4D7300A6AAB4 /* PlatformMouseEventMac.mm */,
                                BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */,
+                               BC7B2AF90450824100A8000F /* PlatformScrollBarMac.mm */,
                                A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */,
                                0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */,
-                               6582A15409999D6D00BEEB6D /* ScreenMac.mm */,
-                               BC7B2AF90450824100A8000F /* PlatformScrollBarMac.mm */,
+                               1402692C0AFE72D8005919E2 /* ScreenMac.mm */,
                                BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */,
                                9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */,
                                93309E9F099EB78C0056E581 /* SharedTimerMac.cpp */,
                        isa = PBXGroup;
                        children = (
                                8538F0000AD71770006A81D1 /* AbstractView.idl */,
+                               14D8238A0AF92DF60004F057 /* Chrome.cpp */,
+                               14D823500AF92A790004F057 /* Chrome.h */,
+                               14D824060AF93AEB0004F057 /* ChromeClient.h */,
                                1403B99609EB13AF00797C7F /* DOMWindow.cpp */,
                                1403B99509EB13AF00797C7F /* DOMWindow.h */,
                                1403B90C09EB124500797C7F /* DOMWindow.idl */,
                                935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */,
                                65FEA86809833ADE00BED4AB /* Page.cpp */,
                                65A21467097A329100B9050A /* Page.h */,
-                               93E22A720AF5E94C00D48324 /* PageState.h */,
                                93E22A6E0AF5E94100D48324 /* PageState.cpp */,
+                               93E22A720AF5E94C00D48324 /* PageState.h */,
                                65D1C1C909932B22000CB324 /* Plugin.h */,
+                               14025EAE0AFD249E005919E2 /* Screen.cpp */,
+                               14025EAF0AFD249E005919E2 /* Screen.h */,
+                               14025EB00AFD249E005919E2 /* ScreenClient.h */,
                                F587863A02DE3A1401EA4122 /* Settings.h */,
-                               14D823500AF92A790004F057 /* Chrome.h */,
-                               14D8238A0AF92DF60004F057 /* Chrome.cpp */,
-                               14D824060AF93AEB0004F057 /* ChromeClient.h */,
                        );
                        path = page;
                        sourceTree = "<group>";
                                65BF023C0974819000C43196 /* FrameMac.mm */,
                                9380F68609A143B2001FDB34 /* FrameViewMac.mm */,
                                935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */,
-                               93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */,
                                55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */,
                                55998A5B052B59CC0017A6C1 /* WebCoreAXObject.mm */,
                                F5B2A4FC02E2220F018635CB /* WebCoreCache.h */,
                                F56234E003026D7301629B47 /* WebCoreEncodings.mm */,
                                654EC60F097778F500DAB52C /* WebCoreFrameBridge.h */,
                                654EC610097778F500DAB52C /* WebCoreFrameBridge.mm */,
-                               6552E7A8096AA11B0006F248 /* WebCoreFrameNamespaces.h */,
-                               6552E7A9096AA11B0006F248 /* WebCoreFrameNamespaces.mm */,
                                F587854C02DE375901EA4122 /* WebCoreFrameView.h */,
                                5126E6BD0A2E3B29005C29FA /* WebCoreIconDatabaseBridge.h */,
                                5126E6BE0A2E3B29005C29FA /* WebCoreIconDatabaseBridge.mm */,
                                F5B2A52B02E22573018635CB /* WebCoreJavaScript.h */,
                                F5B2A52C02E22573018635CB /* WebCoreJavaScript.mm */,
                                BE983D95052A2E0A00892D85 /* WebCoreKeyboardAccess.h */,
-                               65C7F4310979E2620022E453 /* WebCorePageBridge.h */,
-                               65C7F44B0979E8C90022E453 /* WebCorePageBridge.mm */,
                                9394E0A403AA5BBE008635CE /* WebCorePageState.h */,
                                9394E0A503AA5BBE008635CE /* WebCorePageState.mm */,
                                7E6FEED60898582300C44C3F /* WebCoreScriptDebugger.h */,
                                0668E1890ADD9624004128E0 /* PopupMenu.h */,
                                F587852B02DE375901EA4122 /* RegularExpression.cpp */,
                                F58786B302DE3B8601EA4122 /* RegularExpression.h */,
-                               9385F761098D9C3100D90D24 /* Screen.h */,
                                BC7B2AF80450824100A8000F /* ScrollBar.h */,
                                9353673E09AED79200D35CD6 /* ScrollBarMode.h */,
                                BC6D6E2509AF943500F59759 /* ScrollView.h */,
                                A88AD508095248F0001DD196 /* SVGUseElement.h in Headers */,
                                A88AD50A095248F0001DD196 /* SVGViewElement.h in Headers */,
                                A88AD50C095248F0001DD196 /* SVGZoomAndPan.h in Headers */,
-                               6552E7AA096AA11B0006F248 /* WebCoreFrameNamespaces.h in Headers */,
                                A81655E5096BC13900601058 /* SVGMaskElement.h in Headers */,
                                A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */,
                                A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */,
                                BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */,
                                BCB16AFA0979A08500467741 /* FloatRect.h in Headers */,
                                BCB16AFC0979A08500467741 /* IntRect.h in Headers */,
-                               65C7F4320979E2620022E453 /* WebCorePageBridge.h in Headers */,
                                BCB16B8B0979B01400467741 /* DeprecatedArray.h in Headers */,
                                BCB16B8D0979B01400467741 /* ArrayImpl.h in Headers */,
                                BCB16C180979C3BD00467741 /* Cache.h in Headers */,
                                BCC8CFCC0986CD2400140BF2 /* Color.h in Headers */,
                                BCC8D1740988301200140BF2 /* Pen.h in Headers */,
                                BCD75ABC0989A446003E28DF /* Image.h in Headers */,
-                               9385F762098D9C3100D90D24 /* Screen.h in Headers */,
                                9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
                                BC9C328B09933A6E001D6924 /* ImageAnimationObserver.h in Headers */,
                                65D1C1CA09932B22000CB324 /* Plugin.h in Headers */,
                                930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */,
                                14D823520AF92A790004F057 /* Chrome.h in Headers */,
                                14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */,
+                               14025EB20AFD249E005919E2 /* Screen.h in Headers */,
+                               14025EB30AFD249E005919E2 /* ScreenClient.h in Headers */,
                                65DADA000AFD86BF00CE53ED /* FormDataStreamMac.h in Headers */,
                                65DADA180AFD878000CE53ED /* FormData.h in Headers */,
                        );
                                A88AD509095248F0001DD196 /* SVGViewElement.cpp in Sources */,
                                A88AD50B095248F0001DD196 /* SVGZoomAndPan.cpp in Sources */,
                                A88AD5AA09525131001DD196 /* SVGCSSStyleSelector.cpp in Sources */,
-                               6552E7AB096AA11B0006F248 /* WebCoreFrameNamespaces.mm in Sources */,
                                A81655E4096BC13900601058 /* SVGMaskElement.cpp in Sources */,
                                A81369CB097374F600D74463 /* HTMLIsIndexElement.cpp in Sources */,
                                A81369CD097374F600D74463 /* HTMLInputElement.cpp in Sources */,
                                BC73E3920978CED700EDFF8A /* FloatPoint.cpp in Sources */,
                                BCB16AF90979A08500467741 /* FloatRect.cpp in Sources */,
                                BCB16AFB0979A08500467741 /* IntRect.cpp in Sources */,
-                               65C7F44C0979E8C90022E453 /* WebCorePageBridge.mm in Sources */,
                                BCB16B8C0979B01400467741 /* ArrayImpl.cpp in Sources */,
                                BCB16C170979C3BD00467741 /* Cache.cpp in Sources */,
                                BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
                                6582A15D09999D6D00BEEB6D /* IntPointMac.mm in Sources */,
                                6582A15E09999D6D00BEEB6D /* IntRectMac.mm in Sources */,
                                6582A15F09999D6D00BEEB6D /* IntSizeMac.mm in Sources */,
-                               6582A16209999D6D00BEEB6D /* ScreenMac.mm in Sources */,
                                6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */,
                                6582A17809999EA000BEEB6D /* DeprecatedStringMac.mm in Sources */,
                                A7638A8C09958EA50007E14F /* WKDisplacementMapFilter.m in Sources */,
                                9352084509BD43B900F2038D /* Language.mm in Sources */,
                                9352087709BD453400F2038D /* CookieJar.mm in Sources */,
                                14EC268009CA07E000E1EEEC /* EventTargetNode.cpp in Sources */,
-                               93E47C5C09BE2BBB0019C5C1 /* PageMac.mm in Sources */,
                                93EEC1FF09C2877700C515D1 /* CanvasRenderingContext2D.cpp in Sources */,
                                93EEC20209C2877700C515D1 /* CanvasGradient.cpp in Sources */,
                                93EEC26F09C3218000C515D1 /* CanvasPattern.cpp in Sources */,
                                B2A015B90AF6CD53006BCE0E /* SVGResourceMasker.cpp in Sources */,
                                B2EBDC9C0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp in Sources */,
                                14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
+                               14025EB10AFD249E005919E2 /* Screen.cpp in Sources */,
+                               1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */,
+                               1402692D0AFE72D8005919E2 /* ScreenMac.mm in Sources */,
                                65DAD9FC0AFD86B400CE53ED /* FormData.cpp in Sources */,
                                65DADA010AFD86BF00CE53ED /* FormDataStreamMac.mm in Sources */,
                        );
index a03d039..c39cc54 100644 (file)
@@ -195,20 +195,20 @@ JSValue* Screen::getValueProperty(ExecState*, int token) const
 
   switch (token) {
   case Height:
-    return jsNumber(screenRect(page).height());
+    return jsNumber(page->screen()->rect().height());
   case Width:
-    return jsNumber(screenRect(page).width());
+    return jsNumber(page->screen()->rect().width());
   case ColorDepth:
   case PixelDepth:
-    return jsNumber(screenDepth(page));
+    return jsNumber(page->screen()->depth());
   case AvailLeft:
-    return jsNumber(usableScreenRect(page).x() - screenRect(page).x());
+    return jsNumber(page->screen()->usableRect().x() - page->screen()->rect().x());
   case AvailTop:
-    return jsNumber(usableScreenRect(page).y() - screenRect(page).y());
+    return jsNumber(page->screen()->usableRect().y() - page->screen()->rect().y());
   case AvailHeight:
-    return jsNumber(usableScreenRect(page).height());
+    return jsNumber(page->screen()->usableRect().height());
   case AvailWidth:
-    return jsNumber(usableScreenRect(page).width());
+    return jsNumber(page->screen()->usableRect().width());
   default:
     return jsUndefined();
   }
@@ -628,7 +628,7 @@ static JSValue* showModalDialog(ExecState* exec, Window* openerWindow, const Lis
     // - help: boolFeature(features, "help", true), makes help icon appear in dialog (what does it do on Windows?)
     // - unadorned: trusted && boolFeature(features, "unadorned");
 
-    FloatRect screenRect = usableScreenRect(openerWindow->frame()->page());
+    FloatRect screenRect = openerWindow->frame()->page()->screen()->usableRect();
 
     wargs.width = floatFeature(features, "dialogwidth", 100, screenRect.width(), 620); // default here came from frame size of dialog in MacIE
     wargs.widthSet = true;
@@ -745,9 +745,9 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
       else
         return jsNull();
     case OuterHeight:
-        return jsNumber(m_frame->page()->windowRect().height());
+        return jsNumber(m_frame->page()->chrome()->windowRect().height());
     case OuterWidth:
-        return jsNumber(m_frame->page()->windowRect().width());
+        return jsNumber(m_frame->page()->chrome()->windowRect().width());
     case PageXOffset:
       if (!m_frame->view())
         return jsUndefined();
@@ -764,10 +764,10 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
       return personalbar(exec);
     case ScreenLeft:
     case ScreenX:
-      return jsNumber(m_frame->page()->windowRect().x());
+      return jsNumber(m_frame->page()->chrome()->windowRect().x());
     case ScreenTop:
     case ScreenY:
-      return jsNumber(m_frame->page()->windowRect().y());
+      return jsNumber(m_frame->page()->chrome()->windowRect().y());
     case ScrollX:
       if (!m_frame->view())
         return jsUndefined();
@@ -1568,7 +1568,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
       WindowFeatures windowFeatures;
       String features = args[2]->isUndefinedOrNull() ? UString() : args[2]->toString(exec);
       parseWindowFeatures(features, windowFeatures);
-      constrainToVisible(screenRect(page), windowFeatures);
+      constrainToVisible(page->screen()->rect(), windowFeatures);
       
       // prepare arguments
       KURL url;
@@ -1647,44 +1647,44 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
     return jsUndefined();
   case Window::MoveBy:
     if (args.size() >= 2 && page) {
-      FloatRect r = page->windowRect();
+      FloatRect r = page->chrome()->windowRect();
       r.move(args[0]->toNumber(exec), args[1]->toNumber(exec));
       // Security check (the spec talks about UniversalBrowserWrite to disable this check...)
-      if (screenRect(page).contains(r))
-        page->setWindowRect(r);
+      if (page->screen()->rect().contains(r))
+        page->chrome()->setWindowRect(r);
     }
     return jsUndefined();
   case Window::MoveTo:
     if (args.size() >= 2 && page) {
-      FloatRect r = page->windowRect();
-      FloatRect sr = screenRect(page);
+      FloatRect r = page->chrome()->windowRect();
+      FloatRect sr = page->screen()->rect();
       r.setLocation(sr.location());
       r.move(args[0]->toNumber(exec), args[1]->toNumber(exec));
       // Security check (the spec talks about UniversalBrowserWrite to disable this check...)
       if (sr.contains(r))
-        page->setWindowRect(r);
+        page->chrome()->setWindowRect(r);
     }
     return jsUndefined();
   case Window::ResizeBy:
     if (args.size() >= 2 && page) {
-      FloatRect r = page->windowRect();
+      FloatRect r = page->chrome()->windowRect();
       FloatSize dest = r.size() + FloatSize(args[0]->toNumber(exec), args[1]->toNumber(exec));
-      FloatRect sg = screenRect(page);
+      FloatRect sg = page->screen()->rect();
       // Security check: within desktop limits and bigger than 100x100 (per spec)
       if (r.x() + dest.width() <= sg.right() && r.y() + dest.height() <= sg.bottom()
            && dest.width() >= 100 && dest.height() >= 100)
-        page->setWindowRect(FloatRect(r.location(), dest));
+        page->chrome()->setWindowRect(FloatRect(r.location(), dest));
     }
     return jsUndefined();
   case Window::ResizeTo:
     if (args.size() >= 2 && page) {
-      FloatRect r = page->windowRect();
+      FloatRect r = page->chrome()->windowRect();
       FloatSize dest = FloatSize(args[0]->toNumber(exec), args[1]->toNumber(exec));
-      FloatRect sg = screenRect(page);
+      FloatRect sg = page->screen()->rect();
       // Security check: within desktop limits and bigger than 100x100 (per spec)
       if (r.x() + dest.width() <= sg.right() && r.y() + dest.height() <= sg.bottom() &&
            dest.width() >= 100 && dest.height() >= 100)
-        page->setWindowRect(FloatRect(r.location(), dest));
+        page->chrome()->setWindowRect(FloatRect(r.location(), dest));
     }
     return jsUndefined();
   case Window::SetTimeout:
@@ -2411,17 +2411,17 @@ JSValue *BarInfo::getValueProperty(ExecState *exec, int token) const
     ASSERT(token == Visible);
     switch (m_type) {
     case Locationbar:
-        return jsBoolean(m_frame->locationbarVisible());
-    case Menubar: 
-        return jsBoolean(m_frame->locationbarVisible());
+        return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
+    case Toolbar:
+        return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
     case Personalbar:
-        return jsBoolean(m_frame->personalbarVisible());
+        return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
+    case Menubar: 
+        return jsBoolean(m_frame->page()->chrome()->menubarVisible());
     case Scrollbars: 
-        return jsBoolean(m_frame->scrollbarsVisible());
+        return jsBoolean(m_frame->page()->chrome()->scrollbarsVisible());
     case Statusbar:
-        return jsBoolean(m_frame->statusbarVisible());
-    case Toolbar:
-        return jsBoolean(m_frame->toolbarVisible());
+        return jsBoolean(m_frame->page()->chrome()->statusbarVisible());
     default:
         return jsBoolean(false);
     }
index c2b6142..564523f 100644 (file)
@@ -147,11 +147,6 @@ public:
     virtual bool runJavaScriptConfirm(const String&);
     virtual bool runJavaScriptPrompt(const String& message, const String& defaultValue, String& result);
     virtual bool shouldInterruptJavaScript();    
-    virtual bool locationbarVisible();
-    virtual bool menubarVisible();
-    virtual bool personalbarVisible();
-    virtual bool statusbarVisible();
-    virtual bool toolbarVisible();
 
     FloatRect customHighlightLineRect(const AtomicString& type, const FloatRect& lineRect);
     void paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text, bool line);
index 77008f4..5e68ec4 100644 (file)
@@ -30,6 +30,7 @@
 #import "AXObjectCache.h"
 #import "BeforeUnloadEvent.h"
 #import "BlockExceptions.h"
+#import "Chrome.h"
 #import "CSSComputedStyleDeclaration.h"
 #import "Cache.h"
 #import "ClipboardEvent.h"
@@ -552,7 +553,7 @@ void FrameMac::focusWindow()
 
     // If we're a top level window, bring the window to the front.
     if (!tree()->parent())
-        [_bridge activateWindow];
+        page()->chrome()->focus();
 
     // Might not have a view yet: this could be a child frame that has not yet received its first byte of data.
     // FIXME: Should remember that the frame needs focus.  See <rdar://problem/4645685>.
@@ -577,7 +578,7 @@ void FrameMac::unfocusWindow()
     if ([_bridge firstResponder] == view) {
         // If we're a top level window, deactivate the window.
         if (!tree()->parent())
-            [_bridge deactivateWindow];
+            page()->chrome()->unfocus();
         else {
             // We want to shift focus to our parent.
             FrameMac* parentFrame = static_cast<FrameMac*>(tree()->parent());
@@ -1199,32 +1200,6 @@ bool FrameMac::shouldInterruptJavaScript()
     return false;
 }
 
-bool FrameMac::locationbarVisible()
-{
-    return [_bridge areToolbarsVisible];
-}
-
-bool FrameMac::menubarVisible()
-{
-    // The menubar is always on in Mac OS X UI
-    return true;
-}
-
-bool FrameMac::personalbarVisible()
-{
-    return [_bridge areToolbarsVisible];
-}
-
-bool FrameMac::statusbarVisible()
-{
-    return [_bridge isStatusbarVisible];
-}
-
-bool FrameMac::toolbarVisible()
-{
-    return [_bridge areToolbarsVisible];
-}
-
 void FrameMac::addMessageToConsole(const String &message, unsigned lineNumber, const String &sourceURL)
 {
     NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
diff --git a/WebCore/bridge/mac/PageMac.mm b/WebCore/bridge/mac/PageMac.mm
deleted file mode 100644 (file)
index 7f8c7d3..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// -*- mode: c++; c-basic-offset: 4 -*-
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#import "config.h"
-#import "Page.h"
-
-#import "BlockExceptions.h"
-#import "Frame.h"
-#import "FloatRect.h"
-#import "Screen.h"
-#import "WebCorePageBridge.h"
-
-namespace WebCore {
-
-void Page::setBridge(WebCorePageBridge* bridge)
-{
-    m_bridge = bridge;
-}
-
-// These methods scale between window and WebView coordinates because JavaScript/DOM operations 
-// assume that the WebView and the window share the same coordinate system.
-
-FloatRect Page::windowRect() const
-{
-    return scaleScreenRectToPageCoordinates(flipScreenRect([bridge() windowFrame]), this);
-}
-
-void Page::setWindowRect(const FloatRect& r)
-{
-    [bridge() setWindowFrame:flipScreenRect(scalePageRectToScreenCoordinates(r, this))];
-}
-
-} // namespace WebCore
index 7ce2b3c..f059abc 100644 (file)
@@ -34,6 +34,7 @@ namespace WebCore {
     class EditorClient;
     class Element;
     class FrameMac;
+    class Page;
     class String;
 }
 
@@ -60,7 +61,6 @@ typedef WebCore::FrameMac WebCoreFrameMac;
 @class DOMNode;
 @class DOMRange;
 @class NSMenu;
-@class WebCorePageBridge;
 @class WebCoreSettings;
 @class WebFrame;
 @class WebScriptObject;
@@ -187,7 +187,7 @@ typedef enum {
 
 + (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;
 
-- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client;
+- (id)initMainFrameWithPage:(WebCore::Page*)page withEditorClient:(WebCoreEditorClient *)client;
 - (id)initSubframeWithOwnerElement:(WebCoreElement *)ownerElement withEditorClient:(WebCoreEditorClient *)client;
 
 - (void)close;
@@ -374,23 +374,12 @@ typedef enum {
 
 - (NSView *)documentView;
 
-- (WebCorePageBridge *)createWindowWithURL:(NSURL *)URL;
-- (void)showWindow;
-
 - (void)setStatusText:(NSString *)status;
 
 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL referrer:(const WebCore::String&)referrer ownerElement:(WebCoreElement *)ownerElement allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
 
 - (NSWindow *)window;
 
-- (void)setToolbarsVisible:(BOOL)visible;
-- (void)setStatusbarVisible:(BOOL)visible;
-- (void)setScrollbarsVisible:(BOOL)visible;
-- (void)setWindowIsResizable:(BOOL)resizable;
-
-- (BOOL)areToolbarsVisible;
-- (BOOL)isStatusbarVisible;
-
 - (NSResponder *)firstResponder;
 - (void)makeFirstResponder:(NSResponder *)responder;
 - (void)willMakeFirstResponderForNodeFocus;
@@ -408,9 +397,6 @@ typedef enum {
 - (void)addMessageToConsole:(NSDictionary *)message;
 - (void)runOpenPanelForFileButtonWithResultListener:(id <WebCoreOpenPanelResultListener>)resultListener;
 
-- (void)activateWindow;
-- (void)deactivateWindow;
-
 - (void)formControlIsBecomingFirstResponder:(NSView *)formControl;
 - (void)formControlIsResigningFirstResponder:(NSView *)formControl;
 
index ca3d1a0..8d23277 100644 (file)
@@ -58,6 +58,7 @@
 #import "ModifySelectionListLevel.h"
 #import "MoveSelectionCommand.h"
 #import "Page.h"
+#import "PlatformMouseEvent.h"
 #import "PlugInInfoStore.h"
 #import "RenderImage.h"
 #import "RenderPart.h"
@@ -73,7 +74,6 @@
 #import "TextIterator.h"
 #import "TypingCommand.h"
 #import "WebCoreEditCommand.h"
-#import "WebCorePageBridge.h"
 #import "WebCoreSettings.h"
 #import "WebCoreSystemInterface.h"
 #import "WebCoreViewFactory.h"
@@ -320,7 +320,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     return bridge([document _document]->frame());
 }
 
-- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client
+- (id)initMainFrameWithPage:(WebCore::Page*)page withEditorClient:(WebCoreEditorClient *)client
 {
     if (!initializedKJS) {
         mainThread = pthread_self();
@@ -332,7 +332,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     if (!(self = [super init]))
         return nil;
 
-    m_frame = new FrameMac([page impl], 0, client);
+    m_frame = new FrameMac(page, 0, client);
     m_frame->setBridge(self);
     _shouldCreateRenderers = YES;
 
@@ -1577,16 +1577,11 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return m_frame ? m_frame->baseWritingDirectionForSelectionStart() : (NSWritingDirection)NSWritingDirectionLeftToRight;
 }
 
-static IntPoint globalPoint(NSWindow* window, NSPoint windowPoint)
-{
-    return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint]));
-}
-
 static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id <NSDraggingInfo> info)
 {
     // FIXME: Fake modifier keys here.
     // [info draggingLocation] is in window coords
-    return PlatformMouseEvent(IntPoint([info draggingLocation]), globalPoint(window, [info draggingLocation]),
+    return PlatformMouseEvent(IntPoint([info draggingLocation]), globalPoint([info draggingLocation], window),
         LeftButton, 0, false, false, false, false);
 }
 
@@ -1663,7 +1658,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
 {
     if (m_frame) {
         // FIXME: Fake modifier keys here.
-        PlatformMouseEvent event(IntPoint(windowLoc), globalPoint([self window], windowLoc),
+        PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [self window]),
             LeftButton, 0, false, false, false, false);
         m_frame->dragSourceMovedTo(event);
     }
@@ -1673,7 +1668,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
 {
     if (m_frame) {
         // FIXME: Fake modifier keys here.
-        PlatformMouseEvent event(IntPoint(windowLoc), globalPoint([self window], windowLoc),
+        PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [self window]),
             LeftButton, 0, false, false, false, false);
         m_frame->dragSourceEndedAt(event, operation);
     }
diff --git a/WebCore/bridge/mac/WebCoreFrameNamespaces.h b/WebCore/bridge/mac/WebCoreFrameNamespaces.h
deleted file mode 100644 (file)
index a2c3bdd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-@interface WebCoreFrameNamespaces : NSObject
-+ (NSEnumerator *)framesInNamespace:(NSString *)name;
-@end
diff --git a/WebCore/bridge/mac/WebCoreFrameNamespaces.mm b/WebCore/bridge/mac/WebCoreFrameNamespaces.mm
deleted file mode 100644 (file)
index 6ae48b7..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "WebCoreFrameNamespaces.h"
-
-#import "Page.h"
-#import <wtf/HashSet.h>
-
-using namespace WebCore;
-
-@implementation WebCoreFrameNamespaces
-
-+ (NSEnumerator *)framesInNamespace:(NSString *)name;
-{
-    const HashSet<Page*>* set = Page::frameNamespace(name);
-    if (!set)
-        return [[[NSEnumerator alloc] init] autorelease];
-    NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity:set->size()];
-    HashSet<Page*>::const_iterator end = set->end();
-    for (HashSet<Page*>::const_iterator it = set->begin(); it != end; ++it) {
-        [array addObject:(*it)->bridge()];
-    }
-    NSEnumerator* enumerator = [array objectEnumerator];
-    [array release];
-    return enumerator;
-}
-
-@end
diff --git a/WebCore/bridge/mac/WebCorePageBridge.h b/WebCore/bridge/mac/WebCorePageBridge.h
deleted file mode 100644 (file)
index 461fe97..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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 <wtf/PassRefPtr.h>
-
-// WebCorePageBridge is used to bridge between Page in WebCore and
-// WebView in WebKit. It is a two-way bridge, with subclasses expected
-// to implement a protocol of bridging methods.
-
-namespace WebCore { 
-    class ChromeClient;
-    class Page;
-}
-
-#ifdef __OBJC__
-@class WebCoreFrameBridge;
-#else
-class WebCoreFrameBridge;
-#endif
-
-// The WebCorePageBridge interface contains methods for use by the
-// non-WebCore side of the bridge.
-
-@interface WebCorePageBridge : NSObject
-{
-    WebCore::Page* _page;
-    BOOL _closed;
-}
-- (id)initWithChromeClient:(PassRefPtr<WebCore::ChromeClient>)chromeClient;
-- (void)close;
-
-- (WebCoreFrameBridge *)mainFrame;
-
-- (void)setGroupName:(NSString *)groupName;
-- (NSString *)groupName;
-
-@end
-
-// The WebCorePageBridge protocol contains methods for use by the WebCore side of the bridge.
-
-@protocol WebCorePageBridge
-
-- (NSView *)outerView;
-
-- (void)setWindowFrame:(NSRect)frame;
-- (NSRect)windowFrame;
-
-- (WebCorePageBridge *)createModalDialogWithURL:(NSURL *)URL referrer:(NSString *)referrer;
-
-@end
-
-// This interface definition allows those who hold a WebCorePageBridge * to call all the methods
-// in the WebCorePageBridge protocol without requiring the base implementation to supply the methods.
-// This idiom is appropriate because WebCorePageBridge is an abstract class.
-
-@interface WebCorePageBridge (SubclassResponsibility) <WebCorePageBridge>
-@end
-
-// One method for internal use within WebCore itself.
-// Could move this to another header, but would be a pity to create an entire header just for that.
-
-@interface WebCorePageBridge (WebCoreInternalUse)
-- (WebCore::Page*)impl;
-@end
index 0928a45..3429d57 100644 (file)
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "MediaQueryEvaluator.h"
 
+#include "Chrome.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSValueList.h"
 #include "DeprecatedString.h"
@@ -207,7 +208,7 @@ static bool numberValue(CSSValue* value, float& result)
 
 static bool colorMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page,  MediaFeaturePrefix op)
 {
-    int bitsPerComponent = screenDepthPerComponent(page);
+    int bitsPerComponent = page->screen()->depthPerComponent();
     float number;
     if (value)
         return numberValue(value, number) && cmpvalue(bitsPerComponent, (int)number, op);
@@ -217,7 +218,7 @@ static bool colorMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* pag
 
 static bool monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page,  MediaFeaturePrefix op)
 {
-    if (!screenIsMonochrome(page))
+    if (!page->screen()->isMonochrome())
         return false;
 
     return colorMediaFeatureEval(value, style, page, op);
@@ -226,7 +227,7 @@ static bool monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Page
 static bool device_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page,  MediaFeaturePrefix op)
 {
     if (value) {
-        FloatRect sg = screenRect(page);
+        FloatRect sg = page->screen()->rect();
         int a = 0;
         int b = 0;
         if (parseAspectRatio(value, a, b))
@@ -242,9 +243,9 @@ static bool device_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle* st
 static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, RenderStyle* style, Page* page, MediaFeaturePrefix op)
 {
     if (value)
-        return value->isPrimitiveValue() && cmpvalue(scaleFactor(page), static_cast<CSSPrimitiveValue*>(value)->getFloatValue(), op);
+        return value->isPrimitiveValue() && cmpvalue(page->chrome()->scaleFactor(), static_cast<CSSPrimitiveValue*>(value)->getFloatValue(), op);
 
-    return scaleFactor(page) != 0;
+    return page->chrome()->scaleFactor() != 0;
 }
 
 static bool gridMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page,  MediaFeaturePrefix op)
@@ -260,7 +261,7 @@ static bool gridMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page
 static bool device_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page,  MediaFeaturePrefix op)
 {
     if (value) {
-        FloatRect sg = screenRect(page);
+        FloatRect sg = page->screen()->rect();
         return value->isPrimitiveValue() && cmpvalue((int)sg.height(), static_cast<CSSPrimitiveValue*>(value)->computeLengthInt(style), op);
     }
     // ({,min-,max-}device-height)
@@ -271,7 +272,7 @@ static bool device_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, P
 static bool device_widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Page* page,  MediaFeaturePrefix op)
 {
     if (value) {
-        FloatRect sg = screenRect(page);
+        FloatRect sg = page->screen()->rect();
         return value->isPrimitiveValue() && cmpvalue((int)sg.width(), static_cast<CSSPrimitiveValue*>(value)->computeLengthInt(style), op);
     }
     // ({,min-,max-}device-width)
index d90d89e..6472d0e 100644 (file)
@@ -34,7 +34,9 @@
 #include "Frame.h"
 #include "GraphicsContext.h"
 #include "HTMLNames.h"
+#include "Page.h"
 #include "RenderHTMLCanvas.h"
+#include "Chrome.h"
 #include "Screen.h"
 #include <math.h>
 
@@ -155,7 +157,7 @@ void HTMLCanvasElement::createDrawingContext() const
 
     float unscaledWidth = width();
     float unscaledHeight = height();
-    float pageScaleFactor = document()->frame() ? scaleFactor(document()->frame()->page()) : 1.0f;
+    float pageScaleFactor = document()->frame() ? document()->frame()->page()->chrome()->scaleFactor() : 1.0f;
     float wf = ceilf(unscaledWidth * pageScaleFactor);
     float hf = ceilf(unscaledHeight * pageScaleFactor);
     
index 6313d18..080a377 100644 (file)
 #include "config.h"
 #include "FrameLoader.h"
 
+#include "Chrome.h"
+#include "DocumentLoader.h"
 #include "Element.h"
+#include "FloatRect.h"
+#include "FormState.h"
 #include "Frame.h"
+#include "FrameLoadRequest.h"
 #include "FrameLoaderClient.h"
-#include "DocumentLoader.h"
-#include "FormState.h"
+#include "FrameTree.h"
 #include "MainResourceLoader.h"
+#include "Page.h"
+#include "WindowFeatures.h"
 
 namespace WebCore {
 
@@ -76,11 +82,60 @@ void FrameLoader::setDefersLoading(bool defers)
     m_client->setDefersLoading(defers);
 }
 
-#if !PLATFORM(MAC)
-Frame* FrameLoader::createWindow(const FrameLoadRequest&, const WindowFeatures&)
-{
-    return 0;
-}
+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())
+#if PLATFORM(MAC)
+                frame->loader()->load(request, true, 0, 0, HashMap<String, String>());
 #endif
+            frame->page()->chrome()->focus();
+            return frame;
+        }
+
+    // FIXME: Setting the referrer should be the caller's responsibility.
+    FrameLoadRequest requestWithReferrer = request;
+    requestWithReferrer.resourceRequest().setHTTPReferrer(m_frame->referrer());
+    
+    Page* page;
+    if (features.dialog)
+        page = m_frame->page()->chrome()->createModalDialog(requestWithReferrer);
+    else
+        page = m_frame->page()->chrome()->createWindow(requestWithReferrer);
+    if (!page)
+        return 0;
+
+    Frame* frame = page->mainFrame();
+    frame->tree()->setName(request.frameName());
+
+    page->chrome()->setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
+    page->chrome()->setStatusbarVisible(features.statusBarVisible);
+    page->chrome()->setScrollbarsVisible(features.scrollbarsVisible);
+    page->chrome()->setMenubarVisible(features.menuBarVisible);
+    page->chrome()->setResizable(features.resizable);
+
+    // 'x' and 'y' specify the location of the window, while 'width' and 'height' 
+    // specify the size of the page. We can only resize the window, so 
+    // adjust for the difference between the window size and the page size.
+
+    FloatRect windowRect = page->chrome()->windowRect();
+    FloatSize pageSize = page->chrome()->pageRect().size();
+    if (features.xSet)
+        windowRect.setX(features.x);
+    if (features.ySet)
+        windowRect.setY(features.y);
+    if (features.widthSet)
+        windowRect.setWidth(features.width + (windowRect.width() - pageSize.width()));
+    if (features.heightSet)
+        windowRect.setHeight(features.height + (windowRect.height() - pageSize.height()));
+    page->chrome()->setWindowRect(windowRect);
+
+    page->chrome()->show();
+
+    return frame;
+}
 
 }
index 30d1c92..83cbc21 100644 (file)
@@ -30,6 +30,7 @@
 #import "FrameLoader.h"
 
 #import "Cache.h"
+#import "Chrome.h"
 #import "DOMElementInternal.h"
 #import "Document.h"
 #import "DocumentLoader.h"
@@ -56,7 +57,6 @@
 #import "TextResourceDecoder.h"
 #import "WebCoreFrameBridge.h"
 #import "WebCoreIconDatabaseBridge.h"
-#import "WebCorePageBridge.h"
 #import "WebCorePageState.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
@@ -169,7 +169,7 @@ void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, Event*
             request.resourceRequest().httpBody(), request.resourceRequest().httpContentType(), event, submitForm, formValues);
 
     if (targetFrame && targetFrame != m_frame)
-        [Mac(targetFrame)->bridge() activateWindow];
+        targetFrame->page()->chrome()->focus();
 }
 
 void FrameLoader::load(const KURL& URL, const String& referrer, FrameLoadType newLoadType,
@@ -373,58 +373,6 @@ 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();
-    
-    // FIXME: We'd like to get frameViewSize from the frame's view, but that doesn't
-    // get created until the frame loads its document.
-    IntSize frameViewSize = IntSize([[pageBridge outerView] frame].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 f75f2a3..73b31da 100644 (file)
@@ -29,8 +29,10 @@ function test() {
 <hr>
 <p>The link below should open a window with the following attributes:</p>
 <ul>
-<li>A WebView whose size matches what you would get from file->New Window</li>
-<li>A window whose positioning matches what you would get from file->New Window</li>
+<li>A window whose size matches what you would get from file->New Window.</li>
+<li>A window whose positioning matches what you would get from file->New Window.</li>
+<li>Statusbar visible.</li>
+<li>Resizable.</li>
 </ul>
 <a href="" onclick='window.open("", "", "status,resizable");'>Click to test</a>
 </body></html>
index 2d96d50..0920e06 100644 (file)
 #include "config.h"
 #include "Chrome.h"
 
+#include "ChromeClient.h"
+#include "FloatRect.h"
 #include "Page.h"
 #include "ResourceLoader.h"
-#include "ChromeClient.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
 
-bool Chrome::canRunModal()
+Chrome::Chrome(Page* page, PassRefPtr<ChromeClient> client)
+    : m_page(page)
+    , m_client(client)
+{
+    ASSERT(m_client);
+}
+
+void Chrome::setWindowRect(const FloatRect& rect) const
+{
+    m_client->setWindowRect(rect);
+}
+
+FloatRect Chrome::windowRect() const
+{
+    return m_client->windowRect();
+}
+
+FloatRect Chrome::pageRect() const
+{
+    return m_client->pageRect();
+}
+        
+float Chrome::scaleFactor()
+{
+    return m_client->scaleFactor();
+}
+    
+void Chrome::focus() const
+{
+    m_client->focus();
+}
+
+void Chrome::unfocus() const
+{
+    m_client->unfocus();
+}
+
+Page* Chrome::createWindow(const FrameLoadRequest& request) const
+{
+    return m_client->createWindow(request);
+}
+
+Page* Chrome::createModalDialog(const FrameLoadRequest& request) const
+{
+    return m_client->createModalDialog(request);
+}
+
+void Chrome::show() const
+{
+    m_client->show();
+}
+
+bool Chrome::canRunModal() const
 {
-    if (!m_client)
-        return false;
     return m_client->canRunModal();
 }
 
-bool Chrome::canRunModalNow()
+bool Chrome::canRunModalNow() const
 {
     // If loads are blocked, we can't run modal because the contents
     // of the modal dialog will never show up!
     return canRunModal() && !ResourceLoader::loadsBlocked();
 }
 
-void Chrome::runModal()
+void Chrome::runModal() const
 {
-    if (!canRunModal())
-        return;
-
     if (m_page->defersLoading()) {
         LOG_ERROR("Tried to run modal in a page when it was deferring loading -- should never happen.");
         return;
@@ -75,4 +125,50 @@ void Chrome::runModal()
         pagesToDefer[i]->setDefersLoading(false);
 }
 
+void Chrome::setToolbarsVisible(bool b) const
+{
+    m_client->setToolbarsVisible(b);
+}
+
+bool Chrome::toolbarsVisible() const
+{
+    return m_client->toolbarsVisible();
+}
+
+void Chrome::setStatusbarVisible(bool b) const
+{
+    m_client->setStatusbarVisible(b);
+}
+
+bool Chrome::statusbarVisible() const
+{
+    return m_client->statusbarVisible();
+}
+
+void Chrome::setScrollbarsVisible(bool b) const
+{
+    m_client->setScrollbarsVisible(b);
+}
+
+bool Chrome::scrollbarsVisible() const
+{
+    return m_client->scrollbarsVisible();
+}
+
+void Chrome::setMenubarVisible(bool b) const
+{
+    m_client->setMenubarVisible(b);
+}
+
+bool Chrome::menubarVisible() const
+{
+    return m_client->menubarVisible();
+}
+
+void Chrome::setResizable(bool b) const
+{
+    m_client->setResizable(b);
+}
+
 } // namespace WebCore
+
index 144038e..05d17a6 100644 (file)
 #ifndef Chrome_h
 #define Chrome_h
 
-#include "ChromeClient.h"
+#include <wtf/Forward.h>
 #include <wtf/RefPtr.h>
-#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
+    class ChromeClient;
+    class FloatRect;
     class Page;
+    struct FrameLoadRequest;
     
     class Chrome {
     public:
-        Chrome(Page* page, PassRefPtr<ChromeClient> client)
-            : m_page(page)
-            , m_client(client)
-        {
-        }
+        Chrome(Page*, PassRefPtr<ChromeClient>);
+
+        ChromeClient* client() { return m_client.get(); }
+
+        void setWindowRect(const FloatRect&) const;
+        FloatRect windowRect() const;
+
+        FloatRect pageRect() const;
+        
+        float scaleFactor();
+
+        void focus() const;
+        void unfocus() const;
+
+        Page* createWindow(const FrameLoadRequest&) const;
+        Page* createModalDialog(const FrameLoadRequest&) const;
+        void show() const;
+
+        bool canRunModal() const;
+        bool canRunModalNow() const;
+        void runModal() const;
+
+        void setToolbarsVisible(bool) const;
+        bool toolbarsVisible() const;
+        
+        void setStatusbarVisible(bool) const;
+        bool statusbarVisible() const;
+        
+        void setScrollbarsVisible(bool) const;
+        bool scrollbarsVisible() const;
+        
+        void setMenubarVisible(bool) const;
+        bool menubarVisible() const;
         
-        bool canRunModal();
-        bool canRunModalNow();
-        void runModal();
+        void setResizable(bool) const;
 
     private:
         Page* m_page;
index 9ddf482..f2fe553 100644 (file)
 
 namespace WebCore {
 
+    class FloatRect;
+    class Page;
+    struct FrameLoadRequest;
+    
     class ChromeClient : public Shared<ChromeClient> {
     public:
         virtual ~ChromeClient() { }
+
+        virtual void setWindowRect(const FloatRect&) = 0;
+        virtual FloatRect windowRect() = 0;
+        
+        virtual FloatRect pageRect() = 0;
         
+        virtual float scaleFactor() = 0;
+    
+        virtual void focus() = 0;
+        virtual void unfocus() = 0;
+
+        virtual Page* createWindow(const FrameLoadRequest&) = 0;
+        virtual Page* createModalDialog(const FrameLoadRequest&) = 0;
+        virtual void show() = 0;
+
         virtual bool canRunModal() = 0;
         virtual void runModal() = 0;
-    };
+
+        virtual void setToolbarsVisible(bool) = 0;
+        virtual bool toolbarsVisible() = 0;
+        
+        virtual void setStatusbarVisible(bool) = 0;
+        virtual bool statusbarVisible() = 0;
+        
+        virtual void setScrollbarsVisible(bool) = 0;
+        virtual bool scrollbarsVisible() = 0;
+        
+        virtual void setMenubarVisible(bool) = 0;
+        virtual bool menubarVisible() = 0;
+
+        virtual void setResizable(bool) = 0;
+};
 
 }
 
index b61eee3..c84c782 100644 (file)
 #include "DOMWindow.h"
 
 #include "cssstyleselector.h"
+#include "Chrome.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSRuleList.h"
 #include "Document.h"
 #include "Element.h"
 #include "Frame.h"
+#include "Page.h"
 #include "Screen.h"
 
 namespace WebCore {
@@ -86,7 +88,7 @@ PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* elt, const String
 
 double DOMWindow::devicePixelRatio() const
 {
-    return scaleFactor(m_frame->page());
+    return m_frame->page()->chrome()->scaleFactor();
 }
 
 } // namespace WebCore
index 7f92982..ec31fb0 100644 (file)
@@ -3101,17 +3101,6 @@ void Frame::sendScrollEvent()
     }
 }
 
-bool Frame::scrollbarsVisible()
-{
-    if (!view())
-        return false;
-    
-    if (view()->hScrollbarMode() == ScrollbarAlwaysOff || view()->vScrollbarMode() == ScrollbarAlwaysOff)
-        return false;
-    
-    return true;
-}
-
 void Frame::addMetaData(const String& key, const String& value)
 {
     d->m_metaData.set(key, value);
index c73b28f..28df3e3 100644 (file)
@@ -204,7 +204,6 @@ public:
 
     void sendResizeEvent();
     void sendScrollEvent();
-    bool scrollbarsVisible();
     bool canMouseDownStartSelect(Node*);
 
     void clearTimers();
@@ -236,11 +235,6 @@ public:
     virtual bool runJavaScriptConfirm(const String& message) = 0;
     virtual bool runJavaScriptPrompt(const String& message, const String& defaultValue, String& result) = 0;  
     virtual bool shouldInterruptJavaScript() = 0;
-    virtual bool locationbarVisible() = 0;
-    virtual bool menubarVisible() = 0;
-    virtual bool personalbarVisible() = 0;
-    virtual bool statusbarVisible() = 0;
-    virtual bool toolbarVisible() = 0;
     virtual void scheduleClose() = 0;
     virtual void focusWindow() = 0;
     virtual void unfocusWindow() = 0;
index 24ae35a..01513a1 100644 (file)
 #include "Page.h"
 
 #include "Chrome.h"
+#include "ChromeClient.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameTree.h"
+#include "Screen.h"
+#include "ScreenClient.h"
 #include "SelectionController.h"
 #include "StringHash.h"
 #include "Widget.h"
@@ -39,9 +42,10 @@ namespace WebCore {
 static HashSet<Page*>* allPages;
 static HashMap<String, HashSet<Page*>*>* frameNamespaces;
 
-Page::Page(PassRefPtr<ChromeClient> chromeClient)
+Page::Page(PassRefPtr<ChromeClient> chromeClient, PassRefPtr<ScreenClient> screenClient)
     : m_dragCaretController(new SelectionController(0, true))
     , m_chrome(new Chrome(this, chromeClient))
+    , m_screen(new Screen(this, screenClient))
     , m_frameCount(0)
     , m_defersLoading(false)
 {
@@ -74,6 +78,7 @@ Page::~Page()
     
     delete m_dragCaretController;
     delete m_chrome;
+    delete m_screen;
 }
 
 void Page::setMainFrame(PassRefPtr<Frame> mainFrame)
index 2ad3896..a56e454 100644 (file)
 #include "PlatformString.h"
 #include <wtf/HashSet.h>
 
-#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class WebCorePageBridge;
-#else
-class WebCorePageBridge;
-#endif
-#endif
-
 #if PLATFORM(WIN)
 typedef struct HWND__* HWND;
 typedef struct HINSTANCE__* HINSTANCE;
@@ -44,21 +36,20 @@ namespace WebCore {
     class Frame;
     class FrameNamespace;
     class FloatRect;
+    class Screen;
+    class ScreenClient;
     class Settings;
     class SelectionController;
     class Widget;
 
     class Page : Noncopyable {
     public:
-        Page(PassRefPtr<ChromeClient>);
+        Page(PassRefPtr<ChromeClient>, PassRefPtr<ScreenClient>);
         ~Page();
 
         void setMainFrame(PassRefPtr<Frame>);
         Frame* mainFrame() const { return m_mainFrame.get(); }
 
-        void setWindowRect(const FloatRect&);
-        FloatRect windowRect() const;
-
         void setGroupName(const String&);
         String groupName() const { return m_groupName; }
 
@@ -74,15 +65,11 @@ namespace WebCore {
 
         SelectionController* dragCaretController() { return m_dragCaretController; }
         Chrome* chrome() { return m_chrome; }
+        Screen* screen() { return m_screen; }
 
         void setDefersLoading(bool);
         bool defersLoading() const { return m_defersLoading; }
 
-#if PLATFORM(MAC)
-        void setBridge(WebCorePageBridge* bridge);
-        WebCorePageBridge* bridge() const { return m_bridge; }
-#endif
-
 #if PLATFORM(WIN)
         // The global DLL or application instance used for all windows.
         static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }
@@ -90,10 +77,9 @@ namespace WebCore {
 #endif
 
     private:
-        void init();
-
         SelectionController* m_dragCaretController;
         Chrome* m_chrome;
+        Screen* m_screen;
 
         RefPtr<Frame> m_mainFrame;
         int m_frameCount;
@@ -101,10 +87,6 @@ namespace WebCore {
 
         bool m_defersLoading;
 
-#if PLATFORM(MAC)
-        WebCorePageBridge* m_bridge;
-#endif
-
 #if PLATFORM(WIN)
         static HINSTANCE s_instanceHandle;
 #endif
diff --git a/WebCore/page/Screen.cpp b/WebCore/page/Screen.cpp
new file mode 100644 (file)
index 0000000..96cd4f3
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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 "Screen.h"
+
+#include "FloatRect.h"
+#include "Page.h"
+#include "ScreenClient.h"
+#include <wtf/RefPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+Screen::Screen(Page* page, PassRefPtr<ScreenClient> client)
+    : m_page(page)
+    , m_client(client)
+{
+    ASSERT(m_client);
+}
+
+int Screen::depth()
+{
+    return m_client->depth();
+}
+
+int Screen::depthPerComponent()
+{
+    return m_client->depthPerComponent();
+}
+
+bool Screen::isMonochrome()
+{
+    return m_client->isMonochrome();
+}
+
+FloatRect Screen::rect()
+{
+    return m_client->rect();
+}
+
+FloatRect Screen::usableRect()
+{
+    return m_client->usableRect();
+}
+
+} // namespace WebCore
diff --git a/WebCore/page/Screen.h b/WebCore/page/Screen.h
new file mode 100644 (file)
index 0000000..72f0144
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+#ifndef Screen_h
+#define Screen_h
+
+#include <wtf/Forward.h>
+#include <wtf/RefPtr.h>
+
+#if PLATFORM(MAC)
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+    typedef struct CGPoint NSPoint;
+    typedef struct CGRect NSRect;
+#else
+    typedef struct _NSPoint NSPoint;
+    typedef struct _NSRect NSRect;
+#endif
+
+#ifdef __OBJC__
+    @class NSScreen;
+    @class NSWindow;
+#else
+    class NSScreen;
+    class NSWindow;
+#endif
+#endif
+
+namespace WebCore {
+
+    class FloatRect;
+    class Page;
+    class ScreenClient;
+    
+    class Screen {
+    public:
+        Screen(Page*, PassRefPtr<ScreenClient>);
+        
+        int depth();
+        int depthPerComponent();
+
+        bool isMonochrome();
+
+        FloatRect rect();
+        FloatRect usableRect();
+
+    private:
+        Page* m_page;
+        RefPtr<ScreenClient> m_client;
+    };
+
+#if PLATFORM(MAC)
+    NSScreen *screen(NSWindow *window);
+    
+    FloatRect scaleFromScreen(const NSRect& rect, NSScreen *screen);
+    NSRect scaleToScreen(const FloatRect& rect, NSScreen *screen);
+
+    NSPoint flipScreenPoint(const NSPoint& screenPoint, NSScreen *screen);
+    NSRect flipScreenRect(const NSRect& rect, NSScreen *screen);
+#endif
+
+} // namespace WebCore
+
+#endif // Screen_h
similarity index 71%
rename from WebCore/platform/Screen.h
rename to WebCore/page/ScreenClient.h
index 555886a..905504d 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SCREEN_H
-#define SCREEN_H
+#ifndef ScreenClient_h
+#define ScreenClient_h
+
+#include "Shared.h"
 
 namespace WebCore {
 
     class FloatRect;
-    class Page;
-
-    int screenDepth(const Page*);
-    int screenDepthPerComponent(const Page*);
-    bool screenIsMonochrome(const Page*);
-    FloatRect screenRect(const Page*);
-    FloatRect usableScreenRect(const Page*);
-
-    FloatRect scaleScreenRectToPageCoordinates(const FloatRect&, const Page*);
-    FloatRect scalePageRectToScreenCoordinates(const FloatRect&, const Page*);
-    float scaleFactor(const Page*);
-
-#if PLATFORM(MAC)
-    NSRect flipScreenRect(NSRect);
-    NSPoint flipScreenPoint(NSPoint);
-#endif
+
+    class ScreenClient : public Shared<ScreenClient> {
+    public:
+        virtual ~ScreenClient() { }
+        
+        virtual int depth() = 0;
+        virtual int depthPerComponent() = 0;
+
+        virtual bool isMonochrome() = 0;
+
+        virtual FloatRect rect() = 0;
+        virtual FloatRect usableRect() = 0;
+    };
     
-}
+} // namespace WebCore
 
-#endif
+#endif // ScreenClient_h
index b0baa46..2b81635 100644 (file)
@@ -35,7 +35,6 @@
 namespace WebCore {
 
     extern WTFLogChannel LogNotYetImplemented;
-
     extern WTFLogChannel LogFrames;
     extern WTFLogChannel LogLoading;
     extern WTFLogChannel LogPopupBlocking;
@@ -45,6 +44,9 @@ namespace WebCore {
     extern WTFLogChannel LogIconDatabase;
     extern WTFLogChannel LogSQLDatabase;
     extern WTFLogChannel LogSpellingAndGrammar;
-}
 
-#endif
+    void InitializeLoggingChannelsIfNecessary();
+
+} // namespace WebCore
+
+#endif // Logging_H
index fbd6812..fe4c5d7 100644 (file)
 #if PLATFORM(MAC)
 #ifdef __OBJC__
 @class NSEvent;
+@class NSScreen;
+@class NSWindow;
 #else
 class NSEvent;
+class NSScreen;
+class NSWindow;
 #endif
 #endif
 
@@ -56,7 +60,7 @@ namespace WebCore {
 
     // These button numbers match the one used in the DOM API.
     enum MouseButton { LeftButton, MiddleButton, RightButton };
-
+    
     class PlatformMouseEvent {
     public:
         static const struct CurrentEventTag {} currentEvent;
@@ -121,6 +125,12 @@ namespace WebCore {
         bool m_metaKey;
     };
 
+#if PLATFORM(MAC)
+    IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *window);
+    IntPoint pointForEvent(NSEvent *event);
+    IntPoint globalPointForEvent(NSEvent *event);
+#endif
+
 } // namespace WebCore
 
 #endif // PlatformMouseEvent_h
similarity index 67%
rename from WebCore/bridge/mac/WebCorePageBridge.mm
rename to WebCore/platform/mac/LoggingMac.mm
index 06f68f4..05e55e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2003, 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
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import "config.h"
-#import "WebCorePageBridge.h"
+#include "Logging.h"
 
-#import "ChromeClient.h"
-#import "FrameMac.h"
-#import "Page.h"
-#import "WebCoreFrameBridge.h"
-#import "Logging.h"
-
-using namespace WebCore;
-
-@implementation WebCorePageBridge
+namespace WebCore {
 
 static inline void initializeLogChannel(WTFLogChannel &channel)
 {
@@ -49,7 +40,7 @@ static inline void initializeLogChannel(WTFLogChannel &channel)
     }
 }
 
-static void initializeLoggingChannelsIfNecessary()
+void InitializeLoggingChannelsIfNecessary()
 {
     static bool haveInitializedLoggingChannels = false;
     if (haveInitializedLoggingChannels)
@@ -68,63 +59,4 @@ static void initializeLoggingChannelsIfNecessary()
     initializeLogChannel(LogSpellingAndGrammar);
 }
 
-- (id)initWithChromeClient:(PassRefPtr<ChromeClient>)chromeClient
-{
-    initializeLoggingChannelsIfNecessary();
-    self = [super init];
-    if (self) {
-        _page = new Page(chromeClient);
-        _page->setBridge(self);
-    }
-    return self;
-}
-
-- (void)dealloc
-{
-    ASSERT(_closed);
-    [super dealloc];
-}
-
-- (void)finalize
-{
-    ASSERT(_closed);
-    [super finalize];
-}
-
-- (void)close
-{
-    delete _page;
-    _page = 0;
-    _closed = YES;
-}
-
-- (WebCoreFrameBridge *)mainFrame
-{
-    if (!_page)
-        return nil;
-    return Mac(_page->mainFrame())->bridge();
-}
-
-- (void)setGroupName:(NSString *)groupName
-{
-    if (_page)
-        _page->setGroupName(groupName);
-}
-
-- (NSString *)groupName
-{
-    if (!_page)
-        return nil;
-    return _page->groupName();
-}
-
-@end
-
-@implementation WebCorePageBridge (WebCoreInternalUse)
-
-- (Page*)impl
-{
-    return _page;
-}
-
-@end
+} // namespace WebCore
index 710a379..ac8450e 100644 (file)
@@ -25,6 +25,7 @@
 
 #import "config.h"
 #import "PlatformMouseEvent.h"
+
 #import "Screen.h"
 
 namespace WebCore {
@@ -50,7 +51,7 @@ static MouseButton mouseButtonForEvent(NSEvent *event)
     }
 }
 
-static IntPoint positionForEvent(NSEvent *event)
+static int clickCountForEvent(NSEvent *event)
 {
     switch ([event type]) {
         case NSLeftMouseDown:
@@ -62,18 +63,18 @@ static IntPoint positionForEvent(NSEvent *event)
         case NSOtherMouseDown:
         case NSOtherMouseUp:
         case NSOtherMouseDragged:
-        case NSMouseMoved:
-        case NSScrollWheel:
-            // Note: This has its origin at the bottom left of the window.
-            // The Y coordinate gets flipped by ScrollView::viewportToContents.
-            // We should probably change both this and that to not use "bottom left origin" coordinates at all.
-            return IntPoint([event locationInWindow]);
+            return [event clickCount];
         default:
-            return IntPoint();
+            return 0;
     }
 }
 
-static IntPoint globalPositionForEvent(NSEvent *event)
+IntPoint globalPoint(const NSPoint& windowPoint, NSWindow* window)
+{
+    return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint], screen(window)));
+}
+
+IntPoint pointForEvent(NSEvent *event)
 {
     switch ([event type]) {
         case NSLeftMouseDown:
@@ -87,13 +88,16 @@ static IntPoint globalPositionForEvent(NSEvent *event)
         case NSOtherMouseDragged:
         case NSMouseMoved:
         case NSScrollWheel:
-            return IntPoint(flipScreenPoint([[event window] convertBaseToScreen:[event locationInWindow]]));
+            // Note: This has its origin at the bottom left of the window.
+            // The Y coordinate gets flipped by ScrollView::viewportToContents.
+            // We should probably change both this and that to not use "bottom left origin" coordinates at all.
+            return IntPoint([event locationInWindow]);
         default:
             return IntPoint();
     }
 }
 
-static int clickCountForEvent(NSEvent *event)
+IntPoint globalPointForEvent(NSEvent *event)
 {
     switch ([event type]) {
         case NSLeftMouseDown:
@@ -105,15 +109,17 @@ static int clickCountForEvent(NSEvent *event)
         case NSOtherMouseDown:
         case NSOtherMouseUp:
         case NSOtherMouseDragged:
-            return [event clickCount];
+        case NSMouseMoved:
+        case NSScrollWheel:
+            return globalPoint([event locationInWindow], [event window]);
         default:
-            return 0;
+            return IntPoint();
     }
 }
 
 PlatformMouseEvent::PlatformMouseEvent(NSEvent* event)
-    : m_position(positionForEvent(event))
-    , m_globalPosition(globalPositionForEvent(event))
+    : m_position(pointForEvent(event))
+    , m_globalPosition(globalPointForEvent(event))
     , m_button(mouseButtonForEvent(event))
     , m_clickCount(clickCountForEvent(event))
     , m_shiftKey([event modifierFlags] & NSShiftKeyMask)
@@ -128,8 +134,8 @@ PlatformMouseEvent::PlatformMouseEvent(const CurrentEventTag&)
 {
     NSEvent* event = [NSApp currentEvent];
     if (event) {
-        m_position = positionForEvent(event);
-        m_globalPosition = globalPositionForEvent(event);
+        m_position = pointForEvent(event);
+        m_globalPosition = globalPointForEvent(event);
         m_button = mouseButtonForEvent(event);
         m_clickCount = clickCountForEvent(event);
         m_shiftKey = [event modifierFlags] & NSShiftKeyMask;
index b47ca18..c1874ae 100644 (file)
 #import "Screen.h"
 
 #import "FloatRect.h"
-#import "Page.h"
-#import "WebCorePageBridge.h"
 
 namespace WebCore {
 
-static NSScreen* screen(const Page* page)
+NSScreen *screen(NSWindow *window)
 {
-    if (page)
-        if (NSScreen* screen = [[[page->bridge() outerView] window] screen])
-            return screen;
-    return [NSScreen mainScreen];
-}
-
-static inline FloatRect scale(const FloatRect& rect, const NSSize& scaleSize)
-{
-    float scaleX = scaleSize.width;
-    float scaleY = scaleSize.height;
+    NSScreen *s = [window screen]; // nil if the window is off-screen
+    if (s)
+        return s;
     
-    return FloatRect(rect.x() * scaleX, rect.y() * scaleY, rect.width() * scaleX, rect.height() * scaleY);
-}
-
-NSRect flipScreenRect(NSRect rect)
-{
-    rect.origin.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - NSMaxY(rect);
-    return rect;
-}
-
-NSPoint flipScreenPoint(NSPoint point)
-{
-    point.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - point.y;
-    return point;
-}
-
-FloatRect scaleScreenRectToPageCoordinates(const FloatRect& rect, const Page* page)
-{
-    NSSize scaleSize = [[page->bridge() outerView] convertSize:NSMakeSize(1.0, 1.0) fromView:nil];
-    return scale(rect, scaleSize);
-}
-
-FloatRect scalePageRectToScreenCoordinates(const FloatRect& rect, const Page* page)
-{
-    NSSize scaleSize = [[page->bridge() outerView] convertSize:NSMakeSize(1.0, 1.0) toView:nil];
-    return scale(rect, scaleSize);
-}
-
-int screenDepth(const Page* page)
-{
-    return NSBitsPerPixelFromDepth([screen(page) depth]);
-}
-
-int screenDepthPerComponent(const Page* page)
-{
-    return NSBitsPerSampleFromDepth([screen(page) depth]);
+    NSArray *screens = [NSScreen screens];
+    if ([screens count] > 0)
+        return [screens objectAtIndex:0]; // screen containing the menubar
+    
+    return nil;
 }
 
-bool screenIsMonochrome(const Page* page)
+FloatRect scaleFromScreen(const NSRect& rect, NSScreen *screen)
 {
-    NSScreen* s = screen(page);
-    NSDictionary* dd = [s deviceDescription];
-    NSString* colorSpaceName = [dd objectForKey:NSDeviceColorSpaceName];
-    return colorSpaceName == NSCalibratedWhiteColorSpace
-        || colorSpaceName == NSCalibratedBlackColorSpace
-        || colorSpaceName == NSDeviceWhiteColorSpace
-        || colorSpaceName == NSDeviceBlackColorSpace;
+    FloatRect scaledRect = rect;
+    scaledRect.scale(1 / [screen userSpaceScaleFactor]);
+    return scaledRect;
 }
 
-float scaleFactor(const Page* page)
+NSRect scaleToScreen(const FloatRect& rect, NSScreen *screen)
 {
-    if (page)
-        return [[[page->bridge() outerView] window] userSpaceScaleFactor];
-    
-    return 1.0f;
+    FloatRect scaledRect = rect;
+    scaledRect.scale([screen userSpaceScaleFactor]);
+    return scaledRect;
 }
 
-// These methods scale between window and WebView coordinates because JavaScript/DOM operations 
-// assume that the WebView and the window share the same coordinate system.
-
-FloatRect screenRect(const Page* page)
+NSPoint flipScreenPoint(const NSPoint& screenPoint, NSScreen *screen)
 {
-    return scaleScreenRectToPageCoordinates(flipScreenRect([screen(page) frame]), page);
+    NSPoint flippedPoint = screenPoint;
+    flippedPoint.y = NSMaxY([screen frame]) - flippedPoint.y;
+    return flippedPoint;
 }
 
-FloatRect usableScreenRect(const Page* page)
+NSRect flipScreenRect(const NSRect& rect, NSScreen *screen)
 {
-    return scaleScreenRectToPageCoordinates(flipScreenRect([screen(page) visibleFrame]), page);
+    NSRect flippedRect = rect;
+    flippedRect.origin.y = NSMaxY([screen frame]) - NSMaxY(flippedRect);
+    return flippedRect;
 }
 
 } // namespace WebCore
index e0fa895..84a7ea8 100644 (file)
 
 #import "config.h"
 #import "PlatformWheelEvent.h"
-#import "Screen.h"
 
-namespace WebCore {
-
-static IntPoint positionForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSScrollWheel:
-            // Note: This has its origin at the bottom left of the window.
-            // The Y coordinate gets flipped by ScrollView::viewportToContents.
-            // We should probably change both this and that to not use "bottom left origin" coordinates at all.
-            return IntPoint([event locationInWindow]);
-        default:
-            return IntPoint();
-    }
-}
+#import "PlatformMouseEvent.h"
 
-static IntPoint globalPositionForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSScrollWheel:
-            return IntPoint(flipScreenPoint([[event window] convertBaseToScreen:[event locationInWindow]]));
-        default:
-            return IntPoint();
-    }
-}
+namespace WebCore {
 
 PlatformWheelEvent::PlatformWheelEvent(NSEvent* event)
-    : m_position(positionForEvent(event))
-    , m_globalPosition(globalPositionForEvent(event))
+    : m_position(pointForEvent(event))
+    , m_globalPosition(globalPointForEvent(event))
     , m_deltaX([event deltaX])
     , m_deltaY([event deltaY])
     , m_isAccepted(false)
@@ -65,4 +43,4 @@ PlatformWheelEvent::PlatformWheelEvent(NSEvent* event)
 {
 }
 
-}
+} // namespace WebCore
index 77fd550..a84a05b 100644 (file)
@@ -30,6 +30,7 @@
 #include "AXObjectCache.h" 
 #include "AffineTransform.h"
 #include "CachedImage.h"
+#include "Chrome.h"
 #include "CounterNode.h"
 #include "CounterResetNode.h"
 #include "TextResourceDecoder.h"
@@ -45,6 +46,7 @@
 #include "KURL.h"
 #include "HitTestRequest.h"
 #include "HitTestResult.h"
+#include "Page.h"
 #include "Position.h"
 #include "RenderArena.h"
 #include "RenderFlexibleBox.h"
@@ -2883,7 +2885,7 @@ void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
         region.bounds.setY(y + styleRegion.offset.top.value());
         
         if (document()->frame()) {
-            float pageScaleFactor = scaleFactor(document()->frame()->page());
+            float pageScaleFactor = document()->frame()->page()->chrome()->scaleFactor();
             if (pageScaleFactor != 1.0f) {
                 region.bounds.scale(pageScaleFactor);
                 region.clip.scale(pageScaleFactor);
index cfc6443..2fc45fd 100644 (file)
@@ -1,3 +1,27 @@
+2006-11-05  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej, Darin, Anders.
+
+        Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient.
+        
+        (WebChromeClient::pageRect): It may seem weird for the page to ask the Chrome/ChromeClient
+        about its own dimensions. The idea here is that we're asking the Chrome how
+        much space it has devoted to the page. We have API for this (-webViewContentRect), but 
+        it was documented incorrectly (even Safari used it wrong), so we don't use 
+        it anymore. Once we fix our API/documentation, we can return to making a
+        delegate callback to ask for the page's size.
+        (WebChromeClient::createWindow): Changed to take a FrameLoadRequest with
+        an appropriate referrer, instead of making up its own.
+        (WebChromeClient::createModalDialog): Changed to take a FrameLoadRequest with
+        an appropriate referrer, instead of broken out parcels.
+        * WebCoreSupport/WebPageBridge.h: Removed. Dead Code.
+        * WebCoreSupport/WebPageBridge.mm: Removed. Dead Code.
+        * WebCoreSupport/WebScreenClient.h: Added.
+        * WebCoreSupport/WebScreenClient.mm: Added.
+        * WebView/WebView.mm: Added NULL checks for new _private->page, since
+        it's not NULL-safe like the bridge was, and it gets cleared before
+        dealloc.
+
 2006-11-06  Graham Dennis  <graham.dennis@gmail.com>
 
         Reviewed by Tim Hatcher.
index 9b53cbf..3879848 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #import <WebCore/ChromeClient.h>
+
 #import <wtf/Forward.h>
 
 @class WebView;
@@ -35,9 +36,39 @@ class WebChromeClient : public WebCore::ChromeClient {
 public:
     static PassRefPtr<WebChromeClient> create(WebView *webView);
     
+    WebView *webView() { return m_webView; }
+    
+    virtual void setWindowRect(const WebCore::FloatRect&);
+    virtual WebCore::FloatRect windowRect();
+
+    virtual WebCore::FloatRect pageRect();
+
+    virtual float scaleFactor();
+
+    virtual void focus();
+    virtual void unfocus();
+
+    virtual WebCore::Page* createWindow(const WebCore::FrameLoadRequest&);
+    virtual WebCore::Page* createModalDialog(const WebCore::FrameLoadRequest&);
+    virtual void show();
+
     virtual bool canRunModal();
     virtual void runModal();
 
+    virtual void setToolbarsVisible(bool);
+    virtual bool toolbarsVisible();
+    
+    virtual void setStatusbarVisible(bool);
+    virtual bool statusbarVisible();
+    
+    virtual void setScrollbarsVisible(bool);
+    virtual bool scrollbarsVisible();
+    
+    virtual void setMenubarVisible(bool);
+    virtual bool menubarVisible();
+    
+    virtual void setResizable(bool);
+
 private:
     WebChromeClient(WebView *webView);
     
index 80b485b..37204cc 100644 (file)
  */
 
 #import "WebChromeClient.h"
-#import "WebView.h"
-#import "WebUIDelegate.h"
+
 #import "WebDefaultUIDelegate.h"
+#import "WebFrameInternal.h"
+#import "WebFrameView.h"
+#import "WebNSURLRequestExtras.h"
+#import "WebScreenClient.h"
+#import "WebUIDelegate.h"
+#import "WebView.h"
+#import "WebViewInternal.h"
+#import <WebCore/FloatRect.h>
+#import <WebCore/FrameLoadRequest.h>
+#import <WebCore/ResourceRequestMac.h>
+#import <WebCore/Screen.h>
 #import <wtf/PassRefPtr.h>
 
+using namespace WebCore;
+
 PassRefPtr<WebChromeClient> WebChromeClient::create(WebView *webView)
 {
     return new WebChromeClient(webView);
@@ -41,7 +53,84 @@ WebChromeClient::WebChromeClient(WebView *webView)
     : m_webView(webView)
 {
 }
-    
+
+// These functions scale between window and WebView coordinates because JavaScript/DOM operations 
+// assume that the WebView and the window share the same coordinate system.
+
+void WebChromeClient::setWindowRect(const FloatRect& rect)
+{
+    NSScreen *screen = [[m_webView window] screen];
+    NSRect windowRect = flipScreenRect(scaleToScreen(rect, screen), screen);
+    [[m_webView _UIDelegateForwarder] webView:m_webView setFrame:windowRect];
+}
+
+FloatRect WebChromeClient::windowRect()
+{
+    NSScreen *screen = [[m_webView window] screen];
+    NSRect windowRect = [[m_webView _UIDelegateForwarder] webViewFrame:m_webView];
+    return scaleFromScreen(flipScreenRect(windowRect, screen), screen);
+}
+
+// FIXME: We need to add API for setting and getting this.
+FloatRect WebChromeClient::pageRect()
+{
+    return [m_webView frame];
+}
+
+float WebChromeClient::scaleFactor()
+{
+    return [[m_webView window] userSpaceScaleFactor];
+}
+
+void WebChromeClient::focus()
+{
+    [[m_webView _UIDelegateForwarder] webViewFocus:m_webView];
+}
+
+void WebChromeClient::unfocus()
+{
+    [[m_webView _UIDelegateForwarder] webViewUnfocus:m_webView];
+}
+
+Page* WebChromeClient::createWindow(const FrameLoadRequest& request)
+{
+    NSURLRequest *URLRequest = nil;
+    if (!request.isEmpty())
+        URLRequest = nsURLRequest(request.resourceRequest());
+
+    WebView *newWebView;
+    id delegate = [m_webView UIDelegate];
+    if ([delegate respondsToSelector:@selector(webView:createWebViewWithRequest:)])
+        newWebView = [delegate webView:m_webView createWebViewWithRequest:URLRequest];
+    else
+        newWebView = [[WebDefaultUIDelegate sharedUIDelegate] webView:m_webView createWebViewWithRequest:URLRequest];
+
+    return core(newWebView);
+}
+
+Page* WebChromeClient::createModalDialog(const FrameLoadRequest& request)
+{
+    NSURLRequest *URLRequest = nil;
+    if (!request.isEmpty())
+        URLRequest = nsURLRequest(request.resourceRequest());
+
+    WebView *newWebView = nil;
+    id delegate = [m_webView UIDelegate];
+    if ([delegate respondsToSelector:@selector(webView:createWebViewModalDialogWithRequest:)])
+        newWebView = [delegate webView:m_webView createWebViewModalDialogWithRequest:URLRequest];
+    else if ([delegate respondsToSelector:@selector(webView:createWebViewWithRequest:)])
+        newWebView = [delegate webView:m_webView createWebViewWithRequest:URLRequest];
+    else
+        newWebView = [[WebDefaultUIDelegate sharedUIDelegate] webView:m_webView createWebViewWithRequest:URLRequest];
+
+    return core(newWebView);
+}
+
+void WebChromeClient::show()
+{
+    [[m_webView _UIDelegateForwarder] webViewShow:m_webView];
+}
+
 bool WebChromeClient::canRunModal()
 {
     return [[m_webView UIDelegate] respondsToSelector:@selector(webViewRunModal:)];
@@ -51,3 +140,57 @@ void WebChromeClient::runModal()
 {
     [[m_webView UIDelegate] webViewRunModal:m_webView];
 }
+
+void WebChromeClient::setToolbarsVisible(bool b)
+{
+    [[m_webView _UIDelegateForwarder] webView:m_webView setToolbarsVisible:b];
+}
+
+bool WebChromeClient::toolbarsVisible()
+{
+    id delegate = [m_webView UIDelegate];
+    if ([delegate respondsToSelector:@selector(webViewAreToolbarsVisible:)])
+        return [delegate webViewAreToolbarsVisible:m_webView];
+    return [[WebDefaultUIDelegate sharedUIDelegate] webViewAreToolbarsVisible:m_webView];
+}
+
+void WebChromeClient::setStatusbarVisible(bool b)
+{
+    [[m_webView _UIDelegateForwarder] webView:m_webView setStatusBarVisible:b];
+}
+
+bool WebChromeClient::statusbarVisible()
+{
+    id delegate = [m_webView UIDelegate];
+    if ([delegate respondsToSelector:@selector(webViewIsStatusBarVisible:)])
+        return [delegate webViewIsStatusBarVisible:m_webView];
+    return [[WebDefaultUIDelegate sharedUIDelegate] webViewIsStatusBarVisible:m_webView];
+}
+
+
+void WebChromeClient::setScrollbarsVisible(bool b)
+{
+    [[[m_webView mainFrame] frameView] setAllowsScrolling:b];
+}
+
+bool WebChromeClient::scrollbarsVisible()
+{
+    return [[[m_webView mainFrame] frameView] allowsScrolling];
+}
+
+void WebChromeClient::setMenubarVisible(bool)
+{
+    // The menubar is always visible in Mac OS X.
+    return;
+}
+
+bool WebChromeClient::menubarVisible()
+{
+    // The menubar is always visible in Mac OS X.
+    return true;
+}
+
+void WebChromeClient::setResizable(bool b)
+{
+    [[m_webView _UIDelegateForwarder] webView:m_webView setResizable:b];
+}
index 1cd0973..aeb47db 100644 (file)
 
 #import <WebCore/WebCoreFrameBridge.h>
 
-@class WebPageBridge;
+namespace WebCore {
+    class Page;
+}
+
 @class WebFrame;
 @class WebFrameView;
 
@@ -49,7 +52,7 @@
     NSDictionary *lastDashboardRegions;
 }
 
-- (id)initMainFrameWithPage:(WebPageBridge *)page frameName:(NSString *)name view:(WebFrameView *)view;
+- (id)initMainFrameWithPage:(WebCore::Page*)page frameName:(NSString *)name view:(WebFrameView *)view webView:(WebView *)webView;
 - (void)close;
 
 - (WebFrame *)webFrame;
index 9bb81e6..712716d 100644 (file)
@@ -59,7 +59,6 @@
 #import "WebNetscapePluginEmbeddedView.h"
 #import "WebNetscapePluginPackage.h"
 #import "WebNullPluginView.h"
-#import "WebPageBridge.h"
 #import "WebPlugin.h"
 #import "WebPluginController.h"
 #import "WebPluginDatabase.h"
@@ -83,7 +82,6 @@
 #import <WebCore/Page.h>
 #import <WebCore/ResourceLoader.h>
 #import <WebCore/SubresourceLoader.h>
-#import <WebCore/WebCoreFrameNamespaces.h>
 #import <WebCore/WebCoreSettings.h>
 #import <WebKitSystemInterface.h>
 #import <wtf/RefPtr.h>
@@ -115,8 +113,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
 - (WebView *)webView
 {
-    ASSERT([[self _frame]->page()->bridge() isKindOfClass:[WebPageBridge class]]);
-    return [(WebPageBridge *)[self _frame]->page()->bridge() webView];
+    return kit(m_frame->page());
 }
 
 - (void)finishInitializingWithFrameName:(NSString *)name view:(WebFrameView *)view
@@ -126,15 +123,15 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     _frame = [[WebFrame alloc] _initWithWebFrameView:view webView:webView coreFrame:m_frame];
     ++WebBridgeCount;
 
-    [self _frame]->tree()->setName(name);
-    [self _frame]->setSettings([[webView _settings] settings]);
+    m_frame->tree()->setName(name);
+    m_frame->setSettings([[webView _settings] settings]);
     [self setTextSizeMultiplier:[webView textSizeMultiplier]];
 }
 
-- (id)initMainFrameWithPage:(WebPageBridge *)page frameName:(NSString *)name view:(WebFrameView *)view
+- (id)initMainFrameWithPage:(WebCore::Page*)page frameName:(NSString *)name view:(WebFrameView *)view webView:(WebView *)webView
 {
     // FIXME: Need to clear the WebView pointer in WebEditorClient when the WebView is deallocated.
-    self = [super initMainFrameWithPage:page withEditorClient:new WebEditorClient([page webView])];
+    self = [super initMainFrameWithPage:page withEditorClient:new WebEditorClient(webView)];
     [self finishInitializingWithFrameName:name view:view];
     return self;
 }
@@ -236,79 +233,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     return [[_frame frameView] documentView];
 }
 
-- (WebCorePageBridge *)createWindowWithURL:(NSURL *)URL
-{
-    ASSERT(_frame != nil);
-
-    NSMutableURLRequest *request = nil;
-    if (URL != nil && ![URL _web_isEmpty]) {
-        request = [NSMutableURLRequest requestWithURL:URL];
-        [request _web_setHTTPReferrer:m_frame->referrer()];
-    }
-
-    WebView *currentWebView = [self webView];
-    id wd = [currentWebView UIDelegate];
-    WebView *newWebView;
-    if ([wd respondsToSelector:@selector(webView:createWebViewWithRequest:)])
-        newWebView = [wd webView:currentWebView createWebViewWithRequest:request];
-    else
-        newWebView = [[WebDefaultUIDelegate sharedUIDelegate] webView:currentWebView createWebViewWithRequest:request];
-    return [newWebView _pageBridge];
-}
-
-- (void)showWindow
-{
-    WebView *wv = [self webView];
-    [[wv _UIDelegateForwarder] webViewShow:wv];
-}
-
-- (BOOL)areToolbarsVisible
-{
-    ASSERT(_frame != nil);
-    WebView *wv = [self webView];
-    id wd = [wv UIDelegate];
-    if ([wd respondsToSelector:@selector(webViewAreToolbarsVisible:)])
-        return [wd webViewAreToolbarsVisible:wv];
-    return [[WebDefaultUIDelegate sharedUIDelegate] webViewAreToolbarsVisible:wv];
-}
-
-- (void)setToolbarsVisible:(BOOL)visible
-{
-    ASSERT(_frame != nil);
-    WebView *wv = [self webView];
-    [[wv _UIDelegateForwarder] webView:wv setToolbarsVisible:visible];
-}
-
-- (void)setScrollbarsVisible:(BOOL)visible
-{
-    ASSERT(_frame != nil);
-    [[_frame frameView] setAllowsScrolling:visible];
-}
-
-- (BOOL)isStatusbarVisible
-{
-    ASSERT(_frame != nil);
-    WebView *wv = [self webView];
-    id wd = [wv UIDelegate];
-    if ([wd respondsToSelector:@selector(webViewIsStatusBarVisible:)])
-        return [wd webViewIsStatusBarVisible:wv];
-    return [[WebDefaultUIDelegate sharedUIDelegate] webViewIsStatusBarVisible:wv];
-}
-
-- (void)setStatusbarVisible:(BOOL)visible
-{
-    ASSERT(_frame != nil);
-    WebView *wv = [self webView];
-    [[wv _UIDelegateForwarder] webView:wv setStatusBarVisible:visible];
-}
-
-- (void)setWindowIsResizable:(BOOL)resizable
-{
-    ASSERT(_frame != nil);
-    WebView *webView = [self webView];
-    [[webView _UIDelegateForwarder] webView:webView setResizable:resizable];
-}
-
 - (NSResponder *)firstResponder
 {
     ASSERT(_frame != nil);
@@ -474,16 +398,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     _frame = nil;
 }
 
-- (void)activateWindow
-{
-    [[[self webView] _UIDelegateForwarder] webViewFocus:[self webView]];
-}
-
-- (void)deactivateWindow
-{
-   [[[self webView] _UIDelegateForwarder] webViewUnfocus:[self webView]];
-}
-
 - (void)formControlIsBecomingFirstResponder:(NSView *)formControl
 {
     // When a form element becomes first responder, its enclosing WebHTMLView might need to
index ffe39f8..866bad6 100644 (file)
@@ -34,6 +34,7 @@
 #undef private
 
 #import "WebBackForwardList.h"
+#import "WebChromeClient.h"
 #import "WebDataSourceInternal.h"
 #import "WebDefaultResourceLoadDelegate.h"
 #import "WebDocumentInternal.h"
@@ -51,7 +52,6 @@
 #import "WebKitErrorsPrivate.h"
 #import "WebKitNSStringExtras.h"
 #import "WebNSURLExtras.h"
-#import "WebPageBridge.h"
 #import "WebPanelAuthenticationHandler.h"
 #import "WebPolicyDelegate.h"
 #import "WebPreferences.h"
@@ -60,6 +60,7 @@
 #import "WebScriptDebugServerPrivate.h"
 #import "WebUIDelegate.h"
 #import "WebViewInternal.h"
+#import <WebCore/Chrome.h>
 #import <WebCore/Document.h>
 #import <WebCore/DocumentLoader.h>
 #import <WebCore/FormState.h>
@@ -91,13 +92,7 @@ using namespace WebCore;
 
 static inline WebView *getWebView(DocumentLoader* loader)
 {
-    return static_cast<WebPageBridge *>(loader->frameLoader()->frame()->page()->bridge())->_webView;
-}
-
-static inline WebView *getWebView(WebFrame *webFrame)
-{
-   Frame* coreFrame = core(webFrame);
-   return coreFrame ? static_cast<WebPageBridge *>(coreFrame->page()->bridge())->_webView : nil;
+    return kit(loader->frameLoader()->frame()->page());
 }
 
 static inline WebDataSource *dataSource(DocumentLoader* loader)
diff --git a/WebKit/WebCoreSupport/WebPageBridge.h b/WebKit/WebCoreSupport/WebPageBridge.h
deleted file mode 100644 (file)
index 171374f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 <WebCore/WebCorePageBridge.h>
-
-@class WebFrameView;
-@class WebView;
-
-@interface WebPageBridge : WebCorePageBridge <WebCorePageBridge>
-{
-@public
-    WebView *_webView;
-}
-
-- (id)initWithMainFrameName:(NSString *)frameName webView:(WebView *)webView frameView:(WebFrameView *)frameView;
-- (WebView *)webView;
-
-@end
diff --git a/WebKit/WebCoreSupport/WebPageBridge.mm b/WebKit/WebCoreSupport/WebPageBridge.mm
deleted file mode 100644 (file)
index 765a38e..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "WebPageBridge.h"
-
-#import "WebChromeClient.h"
-#import "WebDefaultUIDelegate.h"
-#import "WebFrameBridge.h"
-#import "WebFrameView.h"
-#import "WebNSURLExtras.h"
-#import "WebNSURLRequestExtras.h"
-#import "WebUIDelegate.h"
-#import "WebView.h"
-#import "WebViewInternal.h"
-#import <JavaScriptCore/Assertions.h>
-#import <WebCore/Page.h>
-#import <WebCore/ResourceLoader.h>
-#import <WebCore/WebCoreFrameNamespaces.h>
-#import <wtf/Forward.h>
-
-using namespace WebCore;
-
-@implementation WebPageBridge
-
-- (id)initWithMainFrameName:(NSString *)frameName webView:(WebView *)webView frameView:(WebFrameView *)frameView
-{
-    self = [super initWithChromeClient:WebChromeClient::create(webView)];
-    if (self) {
-        _webView = webView;
-        [[[WebFrameBridge alloc] initMainFrameWithPage:self frameName:frameName view:frameView] release];
-    }
-    return self;
-}
-
-- (WebView *)webView
-{
-    return _webView;
-}
-
-- (NSView *)outerView
-{
-    return [[_webView mainFrame] frameView];
-}
-
-- (void)setWindowFrame:(NSRect)frameRect
-{
-    ASSERT(_webView != nil);
-    [[_webView _UIDelegateForwarder] webView:_webView setFrame:frameRect];
-}
-
-- (NSRect)windowFrame
-{
-    ASSERT(_webView != nil);
-    return [[_webView _UIDelegateForwarder] webViewFrame:_webView];
-}
-
-- (WebCorePageBridge *)createModalDialogWithURL:(NSURL *)URL referrer:(NSString *)referrer
-{
-    ASSERT(_webView != nil);
-
-    NSMutableURLRequest *request = nil;
-
-    if (URL != nil && ![URL _web_isEmpty]) {
-        request = [NSMutableURLRequest requestWithURL:URL];
-        [request _web_setHTTPReferrer:referrer];
-    }
-
-    id UIDelegate = [_webView UIDelegate];
-
-    WebView *newWebView = nil;
-    if ([UIDelegate respondsToSelector:@selector(webView:createWebViewModalDialogWithRequest:)])
-        newWebView = [UIDelegate webView:_webView createWebViewModalDialogWithRequest:request];
-    else if ([UIDelegate respondsToSelector:@selector(webView:createWebViewWithRequest:)])
-        newWebView = [UIDelegate webView:_webView createWebViewWithRequest:request];
-    else
-        newWebView = [[WebDefaultUIDelegate sharedUIDelegate] webView:_webView createWebViewWithRequest:request];
-
-    return [newWebView _pageBridge];
-}
-
-@end
diff --git a/WebKit/WebCoreSupport/WebScreenClient.h b/WebKit/WebCoreSupport/WebScreenClient.h
new file mode 100644 (file)
index 0000000..cdc0261
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+#import <WebCore/ScreenClient.h>
+
+#import <wtf/Forward.h>
+
+@class WebView;
+
+class WebScreenClient : public WebCore::ScreenClient {
+public:
+    static PassRefPtr<WebScreenClient> create(WebView *);
+    
+    int depth();
+    int depthPerComponent();
+
+    bool isMonochrome();
+
+    WebCore::FloatRect rect();
+    WebCore::FloatRect usableRect();
+
+private:
+    WebScreenClient(WebView *);
+    
+    WebView *m_webView;
+};
diff --git a/WebKit/WebCoreSupport/WebScreenClient.mm b/WebKit/WebCoreSupport/WebScreenClient.mm
new file mode 100644 (file)
index 0000000..80126ae
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+#import "WebScreenClient.h"
+
+#import "WebChromeClient.h"
+#import "WebView.h"
+#import <WebCore/FloatRect.h>
+#import <WebCore/Screen.h>
+#import <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+PassRefPtr<WebScreenClient> WebScreenClient::create(WebView *webView)
+{
+    return new WebScreenClient(webView);
+}
+
+WebScreenClient::WebScreenClient(WebView *webView)
+    : m_webView(webView)
+{
+}
+
+int WebScreenClient::depth()
+{
+    return NSBitsPerPixelFromDepth([screen([m_webView window]) depth]);
+}
+
+int WebScreenClient::depthPerComponent()
+{
+    return NSBitsPerSampleFromDepth([screen([m_webView window]) depth]);
+}
+
+bool WebScreenClient::isMonochrome()
+{
+    NSString *colorSpace = NSColorSpaceFromDepth([screen([m_webView window]) depth]);
+    return colorSpace == NSCalibratedWhiteColorSpace
+        || colorSpace == NSCalibratedBlackColorSpace
+        || colorSpace == NSDeviceWhiteColorSpace
+        || colorSpace == NSDeviceBlackColorSpace;
+}
+
+FloatRect WebScreenClient::rect()
+{
+    NSScreen *s = screen([m_webView window]);
+    return scaleFromScreen(flipScreenRect([s frame], s), s);
+}
+
+FloatRect WebScreenClient::usableRect()
+{
+    NSScreen *s = screen([m_webView window]);
+    return scaleFromScreen(flipScreenRect([s visibleFrame], s), s);
+}
index 13d0c11..210a6ec 100644 (file)
@@ -7,6 +7,8 @@
        objects = {
 
 /* Begin PBXBuildFile section */
+               140262DD0AFD9C94005919E2 /* WebScreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 140262DB0AFD9C94005919E2 /* WebScreenClient.h */; };
+               140262DE0AFD9C94005919E2 /* WebScreenClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 140262DC0AFD9C94005919E2 /* WebScreenClient.mm */; };
                14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D8252D0AF955090004F057 /* WebChromeClient.h */; };
                14D825300AF955090004F057 /* WebChromeClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14D8252E0AF955090004F057 /* WebChromeClient.mm */; };
                1C0706630A431E01001078F6 /* WebScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0706620A431E01001078F6 /* WebScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -53,8 +55,6 @@
                656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 658A40950A14853B005E6987 /* WebDataSourceInternal.h */; };
                65A0006908527D1A005620FA /* libWebKitSystemInterface.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65A0006808527D1A005620FA /* libWebKitSystemInterface.a */; };
-               65C7F42C0979DE640022E453 /* WebPageBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C7F42A0979DE640022E453 /* WebPageBridge.h */; };
-               65C7F42D0979DE640022E453 /* WebPageBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65C7F42B0979DE640022E453 /* WebPageBridge.mm */; };
                65E0F88408500917007E5CB9 /* WebNSURLRequestExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0F88208500917007E5CB9 /* WebNSURLRequestExtras.h */; };
                65E0F88508500917007E5CB9 /* WebNSURLRequestExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65E0F88308500917007E5CB9 /* WebNSURLRequestExtras.m */; };
                65E0F9E608500F23007E5CB9 /* WebNSUserDefaultsExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0F9E408500F23007E5CB9 /* WebNSUserDefaultsExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+               140262DB0AFD9C94005919E2 /* WebScreenClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebScreenClient.h; sourceTree = "<group>"; };
+               140262DC0AFD9C94005919E2 /* WebScreenClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScreenClient.mm; sourceTree = "<group>"; };
                14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; };
                14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; };
                1C0706620A431E01001078F6 /* WebScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugServer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                658A40950A14853B005E6987 /* WebDataSourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDataSourceInternal.h; sourceTree = "<group>"; };
                65A0006808527D1A005620FA /* libWebKitSystemInterface.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWebKitSystemInterface.a; sourceTree = BUILT_PRODUCTS_DIR; };
                65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebUIDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               65C7F42A0979DE640022E453 /* WebPageBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebPageBridge.h; sourceTree = "<group>"; };
-               65C7F42B0979DE640022E453 /* WebPageBridge.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WebPageBridge.mm; sourceTree = "<group>"; };
                65DA2608052CC18700A97B31 /* WebHistory.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebHistory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                65E0F88208500917007E5CB9 /* WebNSURLRequestExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSURLRequestExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                65E0F88308500917007E5CB9 /* WebNSURLRequestExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSURLRequestExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */,
                                51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */,
                                51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */,
+                               9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
                                9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */,
                                9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */,
-                               9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
                                84723BE3056D719E0044BFEA /* WebKeyGenerator.h */,
                                84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
-                               65C7F42A0979DE640022E453 /* WebPageBridge.h */,
-                               65C7F42B0979DE640022E453 /* WebPageBridge.mm */,
+                               140262DB0AFD9C94005919E2 /* WebScreenClient.h */,
+                               140262DC0AFD9C94005919E2 /* WebScreenClient.mm */,
                                93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
                                93EB178C09F88D460091F8FF /* WebSystemInterface.m */,
                                F5F7174C02885C5B018635CA /* WebViewFactory.h */,
                                1C68F66D095B5FC100C2984E /* WebInspectorPanel.h in Headers */,
                                1C68F66F095B5FC100C2984E /* WebNodeHighlight.h in Headers */,
                                1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */,
-                               65C7F42C0979DE640022E453 /* WebPageBridge.h in Headers */,
                                ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */,
                                6550B7C7099EFAE90090D781 /* WebArchiver.h in Headers */,
                                DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */,
                                656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */,
                                931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */,
                                14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */,
+                               140262DD0AFD9C94005919E2 /* WebScreenClient.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                1C68F66E095B5FC100C2984E /* WebInspectorPanel.m in Sources */,
                                1C68F670095B5FC100C2984E /* WebNodeHighlight.m in Sources */,
                                1C68F672095B5FC100C2984E /* WebNodeHighlightView.m in Sources */,
-                               65C7F42D0979DE640022E453 /* WebPageBridge.mm in Sources */,
                                6550B7C8099EFAE90090D781 /* WebArchiver.m in Sources */,
                                DD89682109AA87240097E7F0 /* WebElementDictionary.m in Sources */,
                                226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */,
                                1CA57D630AED6A470009BDD0 /* WebGraphicsExtras.c in Sources */,
                                931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */,
                                14D825300AF955090004F057 /* WebChromeClient.mm in Sources */,
+                               140262DE0AFD9C94005919E2 /* WebScreenClient.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 3da9c12..c8aa371 100644 (file)
@@ -34,6 +34,7 @@
 #import "DOMNodeInternal.h"
 #import "DOMRangeInternal.h"
 #import "WebBackForwardList.h"
+#import "WebChromeClient.h"
 #import "WebDataSourceInternal.h"
 #import "WebDocumentInternal.h"
 #import "WebDocumentLoaderMac.h"
@@ -48,7 +49,6 @@
 #import "WebKitStatisticsPrivate.h"
 #import "WebNSURLExtras.h"
 #import "WebNSURLRequestExtras.h"
-#import "WebPageBridge.h"
 #import "WebPolicyDelegatePrivate.h"
 #import "WebNetscapePluginEmbeddedView.h"
 #import "WebNullPluginView.h"
@@ -58,6 +58,7 @@
 #import "WebPreferencesPrivate.h"
 #import "WebScriptDebugDelegatePrivate.h"
 #import "WebViewInternal.h"
+#import <WebCore/Chrome.h>
 #import <WebCore/Document.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameMac.h>
@@ -223,10 +224,23 @@ WebFrame *kit(Frame* frame)
     return frame ? ((WebFrameBridge *)Mac(frame)->bridge())->_frame : nil;
 }
 
-static inline WebView *getWebView(WebFrame *webFrame)
+Page* core(WebView *webView)
 {
-   Frame* coreFrame = core(webFrame);
-   return coreFrame ? ((WebPageBridge *)coreFrame->page()->bridge())->_webView : nil;
+    return [webView page];
+}
+
+WebView *kit(Page* page)
+{
+    WebChromeClient* chromeClient = static_cast<WebChromeClient*>(page->chrome()->client());
+    return chromeClient->webView();
+}
+
+WebView *getWebView(WebFrame *webFrame)
+{
+    Frame* coreFrame = core(webFrame);
+    if (!coreFrame)
+        return nil;
+    return kit(coreFrame->page());
 }
 
 - (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL
index e5e017f..30bf296 100644 (file)
@@ -54,6 +54,7 @@ namespace WebCore {
     class FrameLoader;
     class HTMLElement;
     class Node;
+    class Page;
     class Range;
 }
 
@@ -75,6 +76,11 @@ DOMHTMLElement *kit(WebCore::HTMLElement*);
 WebCore::Range* core(DOMRange *);
 DOMRange *kit(WebCore::Range*);
 
+WebCore::Page* core(WebView *);
+WebView *kit(WebCore::Page*);
+
+WebView *getWebView(WebFrame *webFrame);
+
 @interface WebFramePrivate : NSObject
 {
 @public
index 6c79cf4..ecb9962 100644 (file)
@@ -32,6 +32,7 @@
 #import "DOMRangeInternal.h"
 #import "WebBackForwardList.h"
 #import "WebBaseNetscapePluginView.h"
+#import "WebChromeClient.h"
 #import "WebDOMOperationsPrivate.h"
 #import "WebDashboardRegion.h"
 #import "WebDataSourceInternal.h"
 #import "WebNSUserDefaultsExtras.h"
 #import "WebNSViewExtras.h"
 #import "WebPDFView.h"
-#import "WebPageBridge.h"
 #import "WebPluginDatabase.h"
 #import "WebPolicyDelegate.h"
 #import "WebPreferenceKeysPrivate.h"
 #import "WebPreferencesPrivate.h"
 #import "WebResourceLoadDelegate.h"
+#import "WebScreenClient.h"
 #import "WebScriptDebugDelegatePrivate.h"
 #import "WebScriptDebugServerPrivate.h"
 #import "WebUIDelegate.h"
 #import <Foundation/NSURLConnection.h>
 #import <JavaScriptCore/Assertions.h>
 #import <WebCore/Document.h>
+#import <WebCore/DocumentLoader.h>
 #import <WebCore/Editor.h>
 #import <WebCore/ExceptionHandlers.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameMac.h>
 #import <WebCore/FrameTree.h>
+#import <WebCore/Logging.h>
 #import <WebCore/Page.h>
 #import <WebCore/SelectionController.h>
 #import <WebCore/WebCoreEncodings.h>
 #import <WebCore/WebCoreTextRenderer.h>
 #import <WebCore/WebCoreView.h>
 #import <WebCore/WebDataProtocol.h>
-#import <WebCore/DocumentLoader.h>
 #import <WebKit/DOM.h>
 #import <WebKit/DOMExtensions.h>
 #import <WebKit/DOMPrivate.h>
 #import <WebKitSystemInterface.h>
 #import <objc/objc-runtime.h>
+#import <wtf/RefPtr.h>
 
 using namespace WebCore;
 
@@ -231,7 +234,7 @@ macro(yankAndSelect) \
 @interface WebViewPrivate : NSObject
 {
 @public
-    WebPageBridge *_pageBridge;
+    Page* page;
     
     id UIDelegate;
     id UIDelegateForwarder;
@@ -412,7 +415,7 @@ static BOOL grammarCheckingEnabled;
 
 - (void)dealloc
 {
-    ASSERT(!_pageBridge);
+    ASSERT(!page);
     ASSERT(draggingDocumentView == nil);
 
     delete userAgent;
@@ -647,9 +650,9 @@ static bool debugWidget = true;
     FrameLoader* mainFrameLoader = [[self mainFrame] _frameLoader];
     if (mainFrameLoader)
         mainFrameLoader->detachFromParent();
-    [_private->_pageBridge close];
-    [_private->_pageBridge release];
-    _private->_pageBridge = nil;
+    
+    delete _private->page;
+    _private->page = 0;
 
     // Clear the page cache so we call destroy on all the plug-ins in the page cache to break any retain cycles.
     // See comment in [WebHistoryItem _releaseAllPendingPageCaches] for more information.
@@ -727,6 +730,11 @@ static bool debugWidget = true;
     return newWindowWebView;
 }
 
+- (WebCore::Page*)page
+{
+    return _private->page;
+}
+
 - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items
 {
     NSArray *defaultMenuItems = [[WebDefaultUIDelegate sharedUIDelegate]
@@ -1596,12 +1604,16 @@ WebResourceDelegateImplementationCache WebViewGetResourceLoadDelegateImplementat
 
 - (BOOL)defersCallbacks
 {
-    return [_private->_pageBridge impl]->defersLoading();
+    if (!_private->page)
+        return NO;
+    return _private->page->defersLoading();
 }
 
 - (void)setDefersCallbacks:(BOOL)defer
 {
-    return [_private->_pageBridge impl]->setDefersLoading(defer);
+    if (!_private->page)
+        return;
+    return _private->page->setDefersLoading(defer);
 }
 
 @end
@@ -1800,7 +1812,12 @@ NSMutableDictionary *countInvocations;
     [frameView release];
 
     WebKitInitializeLoggingChannelsIfNecessary();
-    _private->_pageBridge = [[WebPageBridge alloc] initWithMainFrameName:frameName webView:self frameView:frameView];
+    WebCore::InitializeLoggingChannelsIfNecessary();
+
+    _private->page = new Page(WebChromeClient::create(self), WebScreenClient::create(self));
+    WebFrameBridge *mainFrame = [[WebFrameBridge alloc] initMainFrameWithPage:_private->page frameName:frameName view:frameView webView:self];
+    _private->page->setMainFrame(adoptRef([mainFrame _frame]));
+    [mainFrame release];
 
     [self _addToAllWebViewsSet];
     [self setGroupName:groupName];
@@ -2104,7 +2121,9 @@ NS_ENDHANDLER
     // This can be called in initialization, before _private has been set up (3465613)
     if (!_private)
         return nil;
-    return [(WebFrameBridge *)[_private->_pageBridge mainFrame] webFrame];
+    if (!_private->page)
+        return nil;
+    return kit(_private->page->mainFrame());
 }
 
 - (WebFrame *)selectedFrame
@@ -2551,12 +2570,16 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (void)setGroupName:(NSString *)groupName
 {
-    [[self _pageBridge] setGroupName:groupName];
+    if (!_private->page)
+        return;
+    _private->page->setGroupName(groupName);
 }
 
 - (NSString *)groupName
 {
-    return [[self _pageBridge] groupName];
+    if (!_private->page)
+        return nil;
+    return _private->page->groupName();
 }
 
 - (double)estimatedProgress
@@ -2613,7 +2636,9 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (void)removeDragCaret
 {
-    [_private->_pageBridge impl]->dragCaretController()->clear();
+    if (!_private->page)
+        return;
+    _private->page->dragCaretController()->clear();
 }
 
 - (void)setMainFrameURL:(NSString *)URLString
@@ -3650,11 +3675,6 @@ static WebFrameView *containingFrameView(NSView *view)
 
 @implementation WebView (WebViewInternal)
 
-- (WebPageBridge *)_pageBridge
-{
-    return _private->_pageBridge;
-}
-
 - (void)_computeUserAgent
 {
     NSString *userAgent;
index 21410eb..9a87bc0 100644 (file)
 #import "WebViewPrivate.h"
 #import "WebTypesInternal.h"
 
-@class WebPageBridge;
+#ifdef __cplusplus
+namespace WebCore {
+    class Page;
+}
+typedef WebCore::Page WebCorePage;
+#else
+@class WebCorePage;
+#endif
+
 @class WebBasePluginPackage;
 
 #ifdef __cplusplus
@@ -54,7 +62,6 @@ namespace WebCore {
 @end
 
 @interface WebView (WebViewInternal)
-- (WebPageBridge *)_pageBridge;
 #ifdef __cplusplus
 - (WebCore::String&)_userAgent;
 #endif
@@ -64,6 +71,7 @@ id WebViewGetResourceLoadDelegate(WebView *webView);
 WebResourceDelegateImplementationCache WebViewGetResourceLoadDelegateImplementations(WebView *webView);
 
 @interface WebView (WebViewMiscInternal)
+- (WebCorePage*)page;
 - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items;
 - (void)_setInitiatedDrag:(BOOL)initiatedDrag;
 - (id)_UIDelegateForwarder;