+2006-10-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders.
+
+ - converted WebFrameLoaderClient to C++
+ - renamed frame->frameLoader() function to frame->loader()
+ - renamed [bridge impl] to [bridge _frame]
+ - removed some bridge methods
+
+ * WebCore.exp: Added more exports.
+ * WebCore.xcodeproj/project.pbxproj: Made FrameTree.h private instead of project-internal
+ so it can be used in WebKit.
+
+ * bridge/mac/BrowserExtensionMac.mm:
+ (WebCore::BrowserExtensionMac::createNewWindow):
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::createFrame):
+ (WebCore::FrameMac::didFirstLayout):
+ * bridge/mac/WebCoreAXObject.mm:
+ (-[WebCoreAXObject rendererForView:]):
+ * bridge/mac/WebCoreFrameBridge.h:
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge _shouldAllowAccessFrom:]):
+ (-[WebCoreFrameBridge canTargetLoadInFrame:]):
+ (-[WebCoreFrameBridge setOpener:]):
+ (-[WebCoreFrameBridge getData:andResponse:forURL:]):
+ (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
+ (-[WebCoreFrameBridge setTitle:]):
+ (-[WebCoreFrameBridge originalRequestURL]):
+ (-[WebCoreFrameBridge isLoadTypeReload]):
+ (-[WebCoreFrameBridge frameDetached]):
+ (-[WebCoreFrameBridge tokenizerProcessedData]):
+ (-[WebCoreFrameBridge receivedData:textEncodingName:]):
+ (-[WebCoreFrameBridge objectLoadedFromCacheWithURL:response:data:]):
+ (-[WebCoreFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
+ (-[WebCoreFrameBridge reportClientRedirectCancelled:]):
+ (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
+ (-[WebCoreFrameBridge incomingReferrer]):
+ (-[WebCoreFrameBridge isReloading]):
+ (-[WebCoreFrameBridge handledOnloadEvents]):
+ (-[WebCoreFrameBridge mainResourceURLResponse]):
+ (-[WebCoreFrameBridge loadEmptyDocumentSynchronously]):
+ (-[WebCoreFrameBridge _frame]):
+ (-[WebCoreFrameBridge executionContextForView:]):
+ * bridge/mac/WebCorePageBridge.mm:
+ (-[WebCorePageBridge setMainFrame:]):
+ * dom/Position.cpp:
+ (WebCore::Position::upstream):
+ * loader/mac/IconLoaderMac.mm:
+ (IconLoader::notifyIconChanged):
+ * loader/mac/WebDocumentLoader.mm:
+ (WebCore::DocumentLoader::frameLoader):
+ (WebCore::DocumentLoader::stopLoading):
+ (WebCore::DocumentLoader::finishedLoading):
+ (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+ * loader/mac/WebFormState.mm:
+ (WebCore::FormState::FormState):
+ * loader/mac/WebFrameLoader.h:
+ * loader/mac/WebFrameLoader.mm:
+ (WebCore::FrameLoader::~FrameLoader):
+ (WebCore::FrameLoader::prepareForLoadStart):
+ (WebCore::FrameLoader::finalSetupForReplace):
+ (WebCore::FrameLoader::safeLoad):
+ (WebCore::FrameLoader::load):
+ (WebCore::FrameLoader::startLoading):
+ (WebCore::FrameLoader::stopLoadingSubframes):
+ (WebCore::FrameLoader::stopLoading):
+ (WebCore::FrameLoader::cancelPendingArchiveLoad):
+ (WebCore::FrameLoader::defersCallbacksChanged):
+ (WebCore::FrameLoader::setDefersCallbacks):
+ (WebCore::FrameLoader::setDocumentLoader):
+ (WebCore::FrameLoader::provisionalLoadStarted):
+ (WebCore::FrameLoader::clearProvisionalLoad):
+ (WebCore::FrameLoader::identifierForInitialRequest):
+ (WebCore::FrameLoader::willSendRequest):
+ (WebCore::FrameLoader::didReceiveAuthenticationChallenge):
+ (WebCore::FrameLoader::didCancelAuthenticationChallenge):
+ (WebCore::FrameLoader::didReceiveResponse):
+ (WebCore::FrameLoader::didReceiveData):
+ (WebCore::FrameLoader::didFinishLoad):
+ (WebCore::FrameLoader::didFailToLoad):
+ (WebCore::FrameLoader::privateBrowsingEnabled):
+ (WebCore::FrameLoader::receivedMainResourceError):
+ (WebCore::FrameLoader::clientRedirectCancelledOrFinished):
+ (WebCore::FrameLoader::clientRedirected):
+ (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
+ (WebCore::FrameLoader::closeOldDataSources):
+ (WebCore::FrameLoader::opened):
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ (WebCore::FrameLoader::download):
+ (WebCore::FrameLoader::finishedLoading):
+ (WebCore::FrameLoader::notifyIconChanged):
+ (WebCore::FrameLoader::cancelledError):
+ (WebCore::FrameLoader::fileDoesNotExistError):
+ (WebCore::FrameLoader::willUseArchive):
+ (WebCore::FrameLoader::isArchiveLoadPending):
+ (WebCore::FrameLoader::handleUnimplementablePolicy):
+ (WebCore::FrameLoader::cannotShowMIMEType):
+ (WebCore::FrameLoader::interruptionForPolicyChangeError):
+ (WebCore::FrameLoader::canShowMIMEType):
+ (WebCore::FrameLoader::representationExistsForURLScheme):
+ (WebCore::FrameLoader::generatedMIMETypeForURLScheme):
+ (WebCore::FrameLoader::checkContentPolicy):
+ (WebCore::FrameLoader::reloadAllowingStaleData):
+ (WebCore::FrameLoader::reload):
+ (WebCore::FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WebCore::FrameLoader::finishedLoadingDocument):
+ (WebCore::FrameLoader::committedLoad):
+ (WebCore::FrameLoader::revertToProvisional):
+ (WebCore::FrameLoader::setMainDocumentError):
+ (WebCore::FrameLoader::mainReceivedCompleteError):
+ (WebCore::FrameLoader::subframeIsLoading):
+ (WebCore::FrameLoader::willChangeTitle):
+ (WebCore::FrameLoader::didChangeTitle):
+ (WebCore::FrameLoader::checkNewWindowPolicy):
+ (WebCore::FrameLoader::continueAfterNewWindowPolicy):
+ (WebCore::FrameLoader::checkNavigationPolicy):
+ (WebCore::FrameLoader::continueAfterNavigationPolicy):
+ (WebCore::FrameLoader::continueLoadRequestAfterNavigationPolicy):
+ (WebCore::FrameLoader::didFirstLayout):
+ (WebCore::FrameLoader::frameLoadCompleted):
+ (WebCore::FrameLoader::transitionToCommitted):
+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+ (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
+ (WebCore::FrameLoader::sendRemainingDelegateMessages):
+ (WebCore::FrameLoader::requestFromDelegate):
+ (WebCore::FrameLoader::post):
+ (WebCore::FrameLoader::detachChildren):
+ (WebCore::FrameLoader::detachFromParent):
+ (WebCore::FrameLoader::addExtraFieldsToRequest):
+ (WebCore::FrameLoader::actionInformation):
+ (WebCore::FrameLoader::checkLoadComplete):
+ (WebCore::FrameLoader::setClient):
+ (WebCore::FrameLoader::client):
+ (WebCore::FrameLoaderClient::~FrameLoaderClient):
+ * loader/mac/WebFrameLoaderClient.h:
+ * loader/mac/WebLoader.mm:
+ (WebCore::WebResourceLoader::frameLoader):
+ * loader/mac/WebSubresourceLoader.mm:
+ (-[WebCoreSubresourceHandle initWithLoader:]):
+ * page/Frame.cpp:
+ (WebCore::Frame::loader):
+ * page/Frame.h:
+ * platform/mac/SliderMac.mm:
+ (Slider::focusPolicy):
+
2006-10-24 Darin Adler <darin@apple.com>
Rubber stamped by Anders.
__ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE13FrameLoadTypeN3WTF10PassRefPtrINS_9FormStateEEE
__ZN7WebCore11FrameLoader6reloadEv
__ZN7WebCore11FrameLoader8safeLoadEP5NSURL
+__ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
__ZN7WebCore14DocumentLoader12setCommittedEb
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
__ZN7WebCore14DocumentLoader7requestEv
__ZN7WebCore14DocumentLoaderC2EP12NSURLRequest
__ZN7WebCore14DocumentLoaderD2Ev
+__ZN7WebCore16DeprecatedStringD1Ev
+__ZN7WebCore17FrameLoaderClientD2Ev
__ZN7WebCore17WebResourceLoader14cancelledErrorEv
__ZN7WebCore17WebResourceLoader20inConnectionCallbackEv
__ZN7WebCore21isBackForwardLoadTypeE13FrameLoadType
__ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object
+__ZN7WebCore4KURLC1EP5NSURL
+__ZN7WebCore5Frame14scrollToAnchorERKNS_4KURLE
+__ZN7WebCore5Frame20setSelectionFromNoneEv
+__ZN7WebCore5Frame21setProhibitsScrollingEb
+__ZN7WebCore5Frame6indentEv
+__ZN7WebCore5Frame7outdentEv
+__ZN7WebCore8FrameMac10wheelEventEP7NSEvent
+__ZN7WebCore8FrameMac11mayDHTMLCutEv
+__ZN7WebCore8FrameMac11tryDHTMLCutEv
+__ZN7WebCore8FrameMac12mayDHTMLCopyEv
+__ZN7WebCore8FrameMac12tryDHTMLCopyEv
+__ZN7WebCore8FrameMac13mayDHTMLPasteEv
+__ZN7WebCore8FrameMac13tryDHTMLPasteEv
+__ZN7WebCore8FrameMac26dashboardRegionsDictionaryEv
+__ZN7WebCore8FrameMac5clearEv
__ZNK7WebCore11FrameLoader14documentLoaderEv
__ZNK7WebCore11FrameLoader15defersCallbacksEv
__ZNK7WebCore11FrameLoader15firstLayoutDoneEv
__ZNK7WebCore14DocumentLoader9isLoadingEv
__ZNK7WebCore17WebResourceLoader11frameLoaderEv
__ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
+__ZNK7WebCore5Frame15containsPluginsEv
+__ZNK7WebCore5Frame16inViewSourceModeEv
+__ZNK7WebCore5Frame19setInViewSourceModeEb
+__ZNK7WebCore5Frame30applyEditingStyleToBodyElementEv
+__ZNK7WebCore5Frame33removeEditingStyleFromBodyElementEv
+__ZNK7WebCore5Frame4treeEv
+__ZNK7WebCore5Frame6loaderEv
+__ZNK7WebCore8FrameMac17eventMayStartDragEP7NSEvent
+__ZNK7WebCore8FrameMac31fontAttributesForSelectionStartEv
+__ZTVN7WebCore17FrameLoaderClientE
_canonicalURL
_stringIsFileURL
_urlByRemovingComponent
659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 659DDC8109E198BA001BF3C6 /* JSDocument.h */; };
65A21468097A329100B9050A /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21467097A329100B9050A /* Page.h */; };
65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65A21482097A3F5300B9050A /* FrameTree.cpp */; };
- 65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; };
+ 65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
65BAAABE0ADCA015005BB5A4 /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BAAABD0ADCA015005BB5A4 /* RetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
65BF022E0974816300C43196 /* Frame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65BF02290974816300C43196 /* Frame.cpp */; };
65BF022F0974816300C43196 /* Frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BF022A0974816300C43196 /* Frame.h */; settings = {ATTRIBUTES = (Private, ); }; };
// ANSWER: No, because such a method doesn't exist - YET
if (WebCoreFrameBridge *frameBridge = [m_frame->bridge() findFrameNamed:frameName]) {
if (!url.isEmpty())
- [frameBridge impl]->loadRequest(request, true, nil, nil, nil);
+ [frameBridge _frame]->loadRequest(request, true, nil, nil, nil);
[frameBridge activateWindow];
- newFrame = [frameBridge impl];
+ newFrame = [frameBridge _frame];
return;
}
return;
WebCoreFrameBridge *frameBridge = [pageBridge mainFrame];
- if ([frameBridge impl])
- [frameBridge impl]->tree()->setName(AtomicString(request.m_frameName));
+ if ([frameBridge _frame])
+ [frameBridge _frame]->tree()->setName(AtomicString(request.m_frameName));
- newFrame = [frameBridge impl];
+ newFrame = [frameBridge _frame];
[frameBridge setToolbarsVisible:windowFeatures.toolBarVisible || windowFeatures.locationBarVisible];
[frameBridge setStatusbarVisible:windowFeatures.statusBarVisible];
allowsScrolling:allowsScrolling
marginWidth:marginWidth
marginHeight:marginHeight];
- return [childBridge impl];
+ return [childBridge _frame];
END_BLOCK_OBJC_EXCEPTIONS;
return 0;
void FrameMac::didFirstLayout()
{
- [_bridge didFirstLayout];
+ loader()->didFirstLayout();
}
NSMutableDictionary *FrameMac::dashboardRegionsDictionary()
bridge = [bridgeHolder webCoreBridge];
}
- FrameMac* frameMac = [bridge impl];
+ FrameMac* frameMac = [bridge _frame];
if (!frameMac)
return NULL;
namespace WebCore {
class EditorClient;
class Element;
- class FrameLoader;
class FrameMac;
}
typedef WebCore::EditorClient WebCoreEditorClient;
typedef WebCore::Element WebCoreElement;
-typedef WebCore::FrameLoader WebCoreFrameLoader;
typedef WebCore::FrameMac WebCoreFrameMac;
#else
@class NSMenu;
@class WebCoreEditorClient;
@class WebCoreElement;
-@class WebCoreFrameLoader;
@class WebCoreFrameMac;
#endif
@protocol WebCoreRenderTreeCopier;
@protocol WebCoreResourceHandle;
@protocol WebCoreResourceLoader;
-@protocol WebFrameLoaderClient;
-
extern NSString *WebCorePageCacheStateKey;
BOOL _closed;
}
+- (WebCoreFrameMac*)_frame; // underscore to prevent conflict with -[NSView frame]
+
+ (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;
- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client;
- (WebCorePageBridge *)page;
-- (WebCoreFrameBridge *)parent;
-
- (WebCoreFrameBridge *)firstChild;
- (WebCoreFrameBridge *)lastChild;
- (WebCoreFrameBridge *)previousSibling;
- (WebCoreFrameBridge *)childFrameNamed:(NSString *)name;
- (WebCoreFrameBridge *)findFrameNamed:(NSString *)name;
-- (void)provisionalLoadStarted;
-
- (void)openURL:(NSURL *)URL reload:(BOOL)reload
contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
pageCache:(NSDictionary *)pageCache;
-- (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
- (void)addData:(NSData *)data;
- (void)closeURL;
-- (void)stopLoading;
-- (void)didNotOpenURL:(NSURL *)URL;
- (void)invalidatePageCache:(NSDictionary *)pageCache;
- (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer;
- (BOOL)canCachePage;
- (BOOL)saveDocumentToPageCache;
-- (void)end;
-- (void)stop;
-
- (void)clearFrame;
- (void)handleFallbackContent;
- (void)installInFrame:(NSView *)view;
- (void)removeFromFrame;
-- (void)scrollToAnchorWithURL:(NSURL *)URL;
-
- (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity;
- (void)createFrameViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
- (void)mouseDragged:(NSEvent *)event;
// these return YES if event is eaten by WebCore
-- (BOOL)sendScrollWheelEvent:(NSEvent *)event;
- (BOOL)sendContextMenuEvent:(NSEvent *)event;
- (NSView *)nextKeyView;
- (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
- (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts;
-- (NSDictionary *)fontAttributesForSelectionStart;
- (NSWritingDirection)baseWritingDirectionForSelectionStart;
- (NSString *)stringWithData:(NSData *)data; // using the encoding of the frame's main resource
- (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
- (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
- (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
-- (void)indent;
-- (void)outdent;
- (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
- (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
-- (void)applyEditingStyleToBodyElement;
-- (void)removeEditingStyleFromBodyElement;
-- (void)applyEditingStyleToElement:(DOMElement *)element;
-- (void)removeEditingStyleFromElement:(DOMElement *)element;
- (WebScriptObject *)windowScriptObject;
- (NPObject *)windowScriptNPObject;
-- (BOOL)eventMayStartDrag:(NSEvent *)event;
- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
- (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
- (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
- (void)dragSourceMovedTo:(NSPoint)windowLoc;
- (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
-- (BOOL)mayDHTMLCut;
-- (BOOL)mayDHTMLCopy;
-- (BOOL)mayDHTMLPaste;
-- (BOOL)tryDHTMLCut;
-- (BOOL)tryDHTMLCopy;
-- (BOOL)tryDHTMLPaste;
-
-- (NSMutableDictionary *)dashboardRegions;
-
-- (void)clear;
-
- (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
- (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL;
- (BOOL)canProvideDocumentSource;
- (BOOL)canSaveAsWebArchive;
-- (BOOL)containsPlugins;
-
-- (void)setInViewSourceMode:(BOOL)flag;
-- (BOOL)inViewSourceMode;
-
-- (void)setProhibitsScrolling:(BOOL)prohibits;
-
-- (void)setFrameLoaderClient:(id<WebFrameLoaderClient>)client;
-- (WebCoreFrameLoader *)frameLoader;
- (void)setTitle:(NSString *)title;
-- (void)didFirstLayout;
-- (void)notifyIconChanged:(NSURL*)iconURL;
- (NSURL*)originalRequestURL;
- (BOOL)isLoadTypeReload;
- (void)frameDetached;
@interface WebCoreFrameBridge (SubclassResponsibility) <WebCoreFrameBridge>
@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 WebCoreFrameBridge (WebCoreInternalUse)
-- (WebCoreFrameMac*)impl;
-@end
-
// Protocols that make up part of the interaces above.
@protocol WebCoreRenderTreeCopier <NSObject>
#import "RenderTreeAsText.h"
#import "RenderView.h"
#import "RenderWidget.h"
-#import "RetainPtr.h"
#import "ReplaceSelectionCommand.h"
#import "ResourceRequest.h"
+#import "RetainPtr.h"
#import "Screen.h"
#import "SelectionController.h"
#import "TextEncoding.h"
return nil;
}
-// FIXME: this is not getting called any more! security regression...
+#if 0
+// FIXME: This is not getting called any more! security regression!?
- (BOOL)_shouldAllowAccessFrom:(WebCoreFrameBridge *)source
{
// if no source frame, allow access
if (ancestorDomain != nil &&
isCaseSensitiveEqual(sourceDomain, ancestorDomain))
return YES;
-
- ancestor = [ancestor parent];
}
// - allow access if this frame is a toplevel window and the source
// otherwise deny access
return NO;
}
+#endif
- (BOOL)canTargetLoadInFrame:(WebCoreFrameBridge *)targetFrame
{
return YES;
}
- WebCoreFrameBridge *parentBridge = [targetFrame parent];
+ WebCoreFrameBridge *parentBridge = Mac([targetFrame _frame]->tree()->parent())->bridge();
// Allow if target is an entire window.
if (!parentBridge)
return YES;
_closed = YES;
}
-- (WebCoreFrameBridge *)parent
-{
- return bridge(m_frame->tree()->parent());
-}
-
-- (void)provisionalLoadStarted
-{
- m_frame->provisionalLoadStarted();
-}
-
- (void)openURL:(NSURL *)URL reload:(BOOL)reload contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified pageCache:(NSDictionary *)pageCache
{
if (pageCache) {
}
}
-- (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen
-{
- m_frame->setEncoding(encoding, userChosen);
-}
-
- (void)addData:(NSData *)data
{
Document *doc = m_frame->document();
m_frame->closeURL();
}
-- (void)stopLoading
-{
- m_frame->stopLoading();
-}
-
-- (void)didNotOpenURL:(NSURL *)URL
-{
- m_frame->didNotOpenURL(KURL(URL).url());
-}
-
- (void)invalidatePageCache:(NSDictionary *)pageCache
{
// We might have made a page cache item, but now we're bailing out due to an error before we ever
doc->setStateForNewFormElements(stateVector);
}
-- (void)scrollToAnchorWithURL:(NSURL *)URL
-{
- m_frame->scrollToAnchor(KURL(URL).url().latin1());
-}
-
- (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity
{
if (!m_frame)
return m_frame->scrollOverflow((ScrollDirection)direction, (ScrollGranularity)granularity);
}
-- (BOOL)sendScrollWheelEvent:(NSEvent *)event
-{
- return m_frame ? m_frame->wheelEvent(event) : NO;
-}
-
- (BOOL)saveDocumentToPageCache
{
Document *doc = m_frame->document();
return m_frame->canCachePage();
}
-- (void)clear
-{
- m_frame->clear();
-}
-
-- (void)end
-{
- m_frame->end();
-}
-
-- (void)stop
-{
- m_frame->stop();
-}
-
- (void)clearFrame
{
m_frame = 0;
- (void)setOpener:(WebCoreFrameBridge *)bridge;
{
- if (Frame* f = [bridge impl])
+ if (Frame* f = [bridge _frame])
f->setOpener(m_frame);
}
m_frame->applyParagraphStyle([style _CSSStyleDeclaration], static_cast<EditAction>(undoAction));
}
-- (void)indent
-{
- if (!m_frame)
- return;
- m_frame->indent();
-}
-
-- (void)outdent
-{
- if (!m_frame)
- return;
- m_frame->outdent();
-}
-
- (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style
{
if (!m_frame)
return NSOffState;
}
-- (void)applyEditingStyleToBodyElement
-{
- if (!m_frame)
- return;
- m_frame->applyEditingStyleToBodyElement();
-}
-
-- (void)removeEditingStyleFromBodyElement
-{
- if (!m_frame)
- return;
- m_frame->removeEditingStyleFromBodyElement();
-}
-
-- (void)applyEditingStyleToElement:(DOMElement *)element
-{
- if (!m_frame)
- return;
- m_frame->applyEditingStyleToElement([element _element]);
-}
-
-- (void)removeEditingStyleFromElement:(DOMElement *)element
-{
- if (!m_frame)
- return;
- m_frame->removeEditingStyleFromElement([element _element]);
-}
-
- (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts
{
bool multipleFonts = false;
return font;
}
-- (NSDictionary *)fontAttributesForSelectionStart
-{
- return m_frame ? m_frame->fontAttributesForSelectionStart() : nil;
-}
-
- (NSWritingDirection)baseWritingDirectionForSelectionStart
{
// FIXME: remove this NSWritingDirection cast once <rdar://problem/4509035> is fixed
return m_frame ? m_frame->baseWritingDirectionForSelectionStart() : (NSWritingDirection)NSWritingDirectionLeftToRight;
}
-- (BOOL)eventMayStartDrag:(NSEvent *)event
-{
- return m_frame ? m_frame->eventMayStartDrag(event) : NO;
-}
-
static IntPoint globalPoint(NSWindow* window, NSPoint windowPoint)
{
return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint]));
}
}
-- (BOOL)mayDHTMLCut
-{
- return m_frame->mayDHTMLCut();
-}
-
-- (BOOL)mayDHTMLCopy
-{
- return m_frame->mayDHTMLCopy();
-}
-
-- (BOOL)mayDHTMLPaste
-{
- return m_frame->mayDHTMLPaste();
-}
-
-- (BOOL)tryDHTMLCut
-{
- return m_frame->tryDHTMLCut();
-}
-
-- (BOOL)tryDHTMLCopy
-{
- return m_frame->tryDHTMLCopy();
-}
-
-- (BOOL)tryDHTMLPaste
-{
- return m_frame->tryDHTMLPaste();
-}
-
- (DOMRange *)rangeOfCharactersAroundCaret
{
if (!m_frame)
return [DOMRange _rangeWith:makeRange(previous, next).get()];
}
-- (NSMutableDictionary *)dashboardRegions
-{
- return m_frame->dashboardRegionsDictionary();
-}
-
-// FIXME: The following 2 functions are copied from AppKit. It would be best share code.
+// FIXME: The following 2 functions are copied from AppKit. It would be best to share code.
// MF:!!! For now we will use static character sets for the computation, but we should eventually probably make these keys in the language dictionaries.
// MF:!!! The following characters (listed with their nextstep encoding values) were in the preSmartTable in the old text objet, but aren't yet in the new text object: NS_FIGSPACE (0x80), exclamdown (0xa1), sterling (0xa3), yen (0xa5), florin (0xa6) section (0xa7), currency (0xa8), quotesingle (0xa9), quotedblleft (0xaa), guillemotleft (0xab), guilsinglleft (0xac), endash (0xb1), quotesinglbase (0xb8), quotedblbase (0xb9), questiondown (0xbf), emdash (0xd0), plusminus (0xd1).
- (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL
{
- Document* doc = [self impl]->document();
+ Document* doc = m_frame->document();
if (!doc)
return NO;
- (void)getAllResourceDatas:(NSArray **)datas andResponses:(NSArray **)responses
{
- Document* doc = [self impl]->document();
+ Document* doc = m_frame->document();
if (!doc) {
NSArray* emptyArray = [NSArray array];
*datas = emptyArray;
return [self canProvideDocumentSource];
}
-- (BOOL)containsPlugins
-{
- return m_frame->containsPlugins();
-}
-
-- (void)setInViewSourceMode:(BOOL)flag
-{
- m_frame->setInViewSourceMode(flag);
-}
-
-- (BOOL)inViewSourceMode
-{
- return m_frame->inViewSourceMode();
-}
-
-- (void)setProhibitsScrolling:(BOOL)prohibits
-{
- m_frame->setProhibitsScrolling(prohibits);
-}
-
- (BOOL)isMainFrame
{
return m_frame->page()->mainFrame() == m_frame;
}
-- (void)setFrameLoaderClient:(id<WebFrameLoaderClient>)client
-{
- if (!m_frame)
- return;
- m_frame->frameLoader()->setFrameLoaderClient(client);
-}
-
-- (WebCoreFrameLoader *)frameLoader
-{
- if (!m_frame)
- return 0;
- return m_frame->frameLoader();
-}
-
static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
{
NSMutableString *result = [NSMutableString string];
{
if (!m_frame)
return;
- m_frame->frameLoader()->documentLoader()->setTitle(stringByCollapsingNonPrintingCharacters(title));
-}
-
-- (void)didFirstLayout
-{
- if (!m_frame)
- return;
- m_frame->frameLoader()->didFirstLayout();
-}
-
-- (void)notifyIconChanged:(NSURL*)iconURL
-{
- if (!m_frame)
- return;
- m_frame->frameLoader()->notifyIconChanged(iconURL);
+ m_frame->loader()->documentLoader()->setTitle(stringByCollapsingNonPrintingCharacters(title));
}
- (NSURL*)originalRequestURL
{
- return [m_frame->frameLoader()->activeDocumentLoader()->initialRequest() URL];
+ return [m_frame->loader()->activeDocumentLoader()->initialRequest() URL];
}
- (BOOL)isLoadTypeReload
{
- return m_frame->frameLoader()->loadType() == FrameLoadTypeReload;
+ return m_frame->loader()->loadType() == FrameLoadTypeReload;
}
- (void)frameDetached
{
- m_frame->frameLoader()->stopLoading();
- m_frame->frameLoader()->detachFromParent();
+ m_frame->loader()->stopLoading();
+ m_frame->loader()->detachFromParent();
}
- (void)tokenizerProcessedData
{
- m_frame->frameLoader()->checkLoadComplete();
+ m_frame->loader()->checkLoadComplete();
}
- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
{
// Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- NSString *encoding = m_frame ? m_frame->frameLoader()->documentLoader()->overrideEncoding() : nil;
+ NSString *encoding = m_frame ? m_frame->loader()->documentLoader()->overrideEncoding() : nil;
bool userChosen = encoding != nil;
if (!encoding)
encoding = textEncodingName;
- [self setEncoding:encoding userChosen:userChosen];
+ m_frame->setEncoding(encoding, userChosen);
[self addData:data];
}
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
NSError *error;
id identifier;
- m_frame->frameLoader()->requestFromDelegate(request, identifier, error);
- m_frame->frameLoader()->sendRemainingDelegateMessages(identifier, response, [data length], error);
+ m_frame->loader()->requestFromDelegate(request, identifier, error);
+ m_frame->loader()->sendRemainingDelegateMessages(identifier, response, [data length], error);
[request release];
}
- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction
{
- m_frame->frameLoader()->clientRedirected(URL, seconds, date, lockHistory, isJavaScriptFormAction);
+ m_frame->loader()->clientRedirected(URL, seconds, date, lockHistory, isJavaScriptFormAction);
}
- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress
{
- m_frame->frameLoader()->clientRedirectCancelledOrFinished(cancelWithLoadInProgress);
+ m_frame->loader()->clientRedirectCancelledOrFinished(cancelWithLoadInProgress);
}
- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
if (isConditionalRequest(request))
[request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
else
- [request setCachePolicy:[m_frame->frameLoader()->documentLoader()->request() cachePolicy]];
+ [request setCachePolicy:[m_frame->loader()->documentLoader()->request() cachePolicy]];
if (!hideReferrer)
setHTTPReferrer(request, [self referrer]);
WebCorePageBridge *page = [self page];
- [request setMainDocumentURL:[[[page mainFrame] impl]->frameLoader()->documentLoader()->request() URL]];
+ [request setMainDocumentURL:[[[page mainFrame] _frame]->loader()->documentLoader()->request() URL]];
[request setValue:[self userAgentForURL:[request URL]] forHTTPHeaderField:@"User-Agent"];
NSError *error = nil;
id identifier = nil;
- NSURLRequest *newRequest = m_frame->frameLoader()->requestFromDelegate(request, identifier, error);
+ NSURLRequest *newRequest = m_frame->loader()->requestFromDelegate(request, identifier, error);
NSURLResponse *response = nil;
NSData *result = nil;
}
}
- m_frame->frameLoader()->sendRemainingDelegateMessages(identifier, response, [result length], error);
+ m_frame->loader()->sendRemainingDelegateMessages(identifier, response, [result length], error);
[request release];
return result;
- (NSString *)incomingReferrer
{
- return [m_frame->frameLoader()->documentLoader()->request() valueForHTTPHeaderField:@"Referer"];
+ return [m_frame->loader()->documentLoader()->request() valueForHTTPHeaderField:@"Referer"];
}
- (BOOL)isReloading
{
- return [m_frame->frameLoader()->documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
+ return [m_frame->loader()->documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
}
- (void)handledOnloadEvents
{
- [m_frame->frameLoader()->client() _dispatchDidHandleOnloadEventsForFrame];
+ m_frame->loader()->client()->dispatchDidHandleOnloadEvents();
}
- (NSURLResponse *)mainResourceURLResponse
{
- return m_frame->frameLoader()->documentLoader()->response();
+ return m_frame->loader()->documentLoader()->response();
}
- (void)loadEmptyDocumentSynchronously
NSURL *url = [[NSURL alloc] initWithString:@""];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
- m_frame->frameLoader()->load(request);
+ m_frame->loader()->load(request);
[request release];
[url release];
}
+- (FrameMac*)_frame
+{
+ return m_frame;
+}
+
@end
@implementation WebCoreFrameBridge (WebCoreBridgeInternal)
- (RootObject *)executionContextForView:(NSView *)aView
{
- FrameMac *frame = [self impl];
+ FrameMac *frame = [self _frame];
RootObject *root = new RootObject(aView); // The root gets deleted by JavaScriptCore.
root->setRootObjectImp(Window::retrieveWindow(frame));
root->setInterpreter(frame->jScript()->interpreter());
}
@end
-
-@implementation WebCoreFrameBridge (WebCoreInternalUse)
-
-- (FrameMac*)impl
-{
- return m_frame;
-}
-
-@end
- (void)setMainFrame:(WebCoreFrameBridge *)mainFrame
{
if (_page)
- _page->setMainFrame(adoptRef([mainFrame impl]));
+ _page->setMainFrame(adoptRef([mainFrame _frame]));
}
- (void)dealloc
#include "IconLoader.h"
#include "FrameMac.h"
-#include "WebCoreFrameBridge.h"
+#include "WebFrameLoader.h"
using namespace WebCore;
void IconLoader::notifyIconChanged(const KURL& iconURL)
{
- FrameMac* frame = Mac(m_frame);
- [frame->bridge() notifyIconChanged:iconURL.getNSURL()];
+ m_frame->loader()->notifyIconChanged(iconURL.getNSURL());
}
{
if (!m_frame)
return 0;
- return m_frame->frameLoader();
+ return m_frame->loader();
}
DocumentLoader::~DocumentLoader()
// but not loads initiated by child frames' data sources -- that's the WebFrame's job.
void DocumentLoader::stopLoading()
{
- // Always attempt to stop the bridge/part because it may still be loading/parsing after the data source
+ // Always attempt to stop the frame because it may still be loading/parsing after the data source
// is done loading and not stopping it can cause a world leak.
if (m_committed)
- [bridge() stopLoading];
+ m_frame->stopLoading();
if (!m_loading)
return;
m_gotFirstByte = true;
commitIfReady();
frameLoader()->finishedLoadingDocument(this);
- [bridge() end];
+ m_frame->end();
}
void DocumentLoader::setCommitted(bool f)
}
frameLoader()->finishedLoadingDocument(this);
- [bridge() end];
+ m_frame->end();
frameLoader()->setReplacing();
m_gotFirstByte = false;
FormState::FormState(DOMElement *form, NSDictionary *values, WebCoreFrameBridge *sourceFrame)
: m_form([form _element])
- , m_sourceFrame([sourceFrame impl])
+ , m_sourceFrame([sourceFrame _frame])
{
NSEnumerator *keyEnumerator = [values keyEnumerator];
while (NSString *key = [keyEnumerator nextObject])
@class WebCoreFrameBridge;
@class WebCoreFrameLoaderAsDelegate;
@class WebPolicyDecider;
-@protocol WebFrameLoaderClient;
namespace WebCore {
class DocumentLoader;
class FormState;
class Frame;
+ class FrameLoaderClient;
class MainResourceLoader;
class WebResourceLoader;
NSDictionary *actionInformation(NavigationType, NSEvent *, NSURL *);
NSDictionary *actionInformation(FrameLoadType loadType, bool isFormSubmission, NSEvent *, NSURL *);
- void setFrameLoaderClient(id <WebFrameLoaderClient>);
- id <WebFrameLoaderClient> client() const;
+ void setClient(FrameLoaderClient*);
+ FrameLoaderClient* client() const;
void continueAfterWillSubmitForm(WebPolicyAction);
void continueAfterNewWindowPolicy(WebPolicyAction);
HashSet<RefPtr<WebResourceLoader> > m_subresourceLoaders;
HashSet<RefPtr<WebResourceLoader> > m_plugInStreamLoaders;
- id <WebFrameLoaderClient> m_client;
+ FrameLoaderClient* m_client;
RefPtr<DocumentLoader> m_documentLoader;
RefPtr<DocumentLoader> m_provisionalDocumentLoader;
using namespace HTMLNames;
-typedef HashSet<RefPtr<WebCore::WebResourceLoader> > ResourceLoaderSet;
+typedef HashSet<RefPtr<WebResourceLoader> > ResourceLoaderSet;
static double storedTimeOfLastCompletedLoad;
FrameLoader::~FrameLoader()
{
[m_asDelegate.get() detachFromLoader];
+ if (m_client)
+ m_client->detachFrameLoader();
}
void FrameLoader::prepareForLoadStart()
{
- [m_client _progressStarted];
- [m_client _dispatchDidStartProvisionalLoadForFrame];
+ m_client->progressStarted();
+ m_client->dispatchDidStartProvisionalLoad();
}
void FrameLoader::setupForReplace()
void FrameLoader::finalSetupForReplace(DocumentLoader* loader)
{
- [m_client _clearUnarchivingStateForLoader:loader];
+ m_client->clearUnarchivingState(loader);
}
void FrameLoader::safeLoad(NSURL *URL)
request.m_request.setURL(URL);
request.m_request.setHTTPReferrer(urlOriginalDataAsString([m_documentLoader->request() URL]));
- [bridge() impl]->loadRequest(request, true, [NSApp currentEvent], nil, nil);
+ Mac(m_frame)->loadRequest(request, true, [NSApp currentEvent], nil, nil);
}
void FrameLoader::load(NSURLRequest *request)
{
// FIXME: is this the right place to reset loadType? Perhaps this should be done after loading is finished or aborted.
m_loadType = FrameLoadTypeStandard;
- load([m_client _createDocumentLoaderWithRequest:request].get());
+ load(m_client->createDocumentLoader(request).get());
}
void FrameLoader::load(NSURLRequest *request, NSString *frameName)
Frame* frame = m_frame->tree()->find(frameName);
if (frame) {
- frame->frameLoader()->load(request);
+ frame->loader()->load(request);
return;
}
void FrameLoader::load(NSURLRequest *request, NSDictionary *action, FrameLoadType type, PassRefPtr<FormState> formState)
{
- RefPtr<DocumentLoader> loader = [m_client _createDocumentLoaderWithRequest:request];
+ RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request);
setPolicyDocumentLoader(loader.get());
loader->setTriggeringAction(action);
if (target) {
Frame* targetFrame = m_frame->tree()->find(target);
if (targetFrame)
- targetFrame->frameLoader()->load(URL, referrer, newLoadType, nil, event, form, values);
+ targetFrame->loader()->load(URL, referrer, newLoadType, nil, event, form, values);
else
checkNewWindowPolicy(request, action, target, formState.release());
[request release];
RefPtr<DocumentLoader> oldDocumentLoader = m_documentLoader;
- bool sameURL = [m_client _shouldTreatURLAsSameAsCurrent:URL];
+ bool sameURL = m_client->shouldTreatURLAsSameAsCurrent(URL);
// Make sure to do scroll to anchor processing even if the URL is
// exactly the same so pages with '#' links and DHTML side effects
NSMutableURLRequest *r = newDocumentLoader->request();
addExtraFieldsToRequest(r, true, false);
FrameLoadType type;
- if ([m_client _shouldTreatURLAsSameAsCurrent:[newDocumentLoader->originalRequest() URL]]) {
+ if (m_client->shouldTreatURLAsSameAsCurrent([newDocumentLoader->originalRequest() URL])) {
[r setCachePolicy:NSURLRequestReloadIgnoringCacheData];
type = FrameLoadTypeSame;
} else
void FrameLoader::load(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> formState)
{
- ASSERT([m_client _hasWebView]);
+ ASSERT(m_client->hasWebView());
// Unfortunately the view must be non-nil, this is ultimately due
// to parser requiring a FrameView. We should fix this dependency.
- ASSERT([m_client _hasFrameView]);
+ ASSERT(m_client->hasFrameView());
m_policyLoadType = type;
if (Frame* parent = m_frame->tree()->parent())
- loader->setOverrideEncoding(parent->frameLoader()->documentLoader()->overrideEncoding());
+ loader->setOverrideEncoding(parent->loader()->documentLoader()->overrideEncoding());
invalidatePendingPolicyDecision(true);
setPolicyDocumentLoader(loader);
if (isLoadingMainResource())
return;
- [m_client _clearLoadingFromPageCacheForDocumentLoader:m_provisionalDocumentLoader.get()];
+ m_client->clearLoadingFromPageCache(m_provisionalDocumentLoader.get());
- id identifier = [m_client _dispatchIdentifierForInitialRequest:m_provisionalDocumentLoader->originalRequest()
- fromDocumentLoader:m_provisionalDocumentLoader.get()];
+ id identifier = m_client->dispatchIdentifierForInitialRequest
+ (m_provisionalDocumentLoader.get(), m_provisionalDocumentLoader->originalRequest());
if (!startLoadingMainResource(m_provisionalDocumentLoader->actualRequest(), identifier))
m_provisionalDocumentLoader->updateLoading();
void FrameLoader::stopLoadingSubframes()
{
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
- child->frameLoader()->stopLoading();
+ child->loader()->stopLoading();
}
void FrameLoader::stopLoading()
if (m_documentLoader)
m_documentLoader->stopLoading();
setProvisionalDocumentLoader(0);
- [m_client _clearArchivedResources];
+ m_client->clearArchivedResources();
m_isStoppingLoad = false;
}
void FrameLoader::cancelPendingArchiveLoad(WebResourceLoader* loader)
{
- [m_client _cancelPendingArchiveLoadForLoader:loader];
+ m_client->cancelPendingArchiveLoad(loader);
}
DocumentLoader* FrameLoader::activeDocumentLoader() const
{
bool defers = defersCallbacks();
for (Frame* child = m_frame; child; child = child->tree()->traverseNext(m_frame))
- child->frameLoader()->setDefersCallbacks(defers);
+ child->loader()->setDefersCallbacks(defers);
}
bool FrameLoader::defersCallbacks() const
m_mainResourceLoader->setDefersCallbacks(defers);
setAllDefersCallbacks(m_subresourceLoaders, defers);
setAllDefersCallbacks(m_plugInStreamLoaders, defers);
- [m_client _setDefersCallbacks:defers];
+ m_client->setDefersCallbacks(defers);
}
bool FrameLoader::isLoadingMainResource() const
ASSERT(loader != m_documentLoader);
ASSERT(!loader || loader->frameLoader() == this);
- [m_client _prepareForDataSourceReplacement];
+ m_client->prepareForDataSourceReplacement();
if (m_documentLoader)
m_documentLoader->detachFromFrame();
void FrameLoader::provisionalLoadStarted()
{
m_firstLayoutDone = false;
- [bridge() provisionalLoadStarted];
- [m_client _provisionalLoadStarted];
+ m_frame->provisionalLoadStarted();
+ m_client->provisionalLoadStarted();
}
void FrameLoader::setState(WebFrameState newState)
void FrameLoader::clearProvisionalLoad()
{
setProvisionalDocumentLoader(0);
- [m_client _progressCompleted];
+ m_client->progressCompleted();
setState(WebFrameStateComplete);
}
id FrameLoader::identifierForInitialRequest(NSURLRequest *clientRequest)
{
- return [m_client _dispatchIdentifierForInitialRequest:clientRequest fromDocumentLoader:activeDocumentLoader()];
+ return m_client->dispatchIdentifierForInitialRequest(activeDocumentLoader(), clientRequest);
}
NSURLRequest *FrameLoader::willSendRequest(WebResourceLoader* loader, NSMutableURLRequest *clientRequest, NSURLResponse *redirectResponse)
{
[clientRequest setValue:[bridge() userAgentForURL:[clientRequest URL]] forHTTPHeaderField:@"User-Agent"];
- return [m_client _dispatchResource:loader->identifier() willSendRequest:clientRequest
- redirectResponse:redirectResponse fromDocumentLoader:activeDocumentLoader()];
+ return m_client->dispatchWillSendRequest(activeDocumentLoader(), loader->identifier(), clientRequest, redirectResponse);
}
void FrameLoader::didReceiveAuthenticationChallenge(WebResourceLoader* loader, NSURLAuthenticationChallenge *currentWebChallenge)
{
- [m_client _dispatchDidReceiveAuthenticationChallenge:currentWebChallenge
- forResource:loader->identifier() fromDocumentLoader:activeDocumentLoader()];
+ m_client->dispatchDidReceiveAuthenticationChallenge(activeDocumentLoader(), loader->identifier(), currentWebChallenge);
}
void FrameLoader::didCancelAuthenticationChallenge(WebResourceLoader* loader, NSURLAuthenticationChallenge *currentWebChallenge)
{
- [m_client _dispatchDidCancelAuthenticationChallenge:currentWebChallenge
- forResource:loader->identifier() fromDocumentLoader:activeDocumentLoader()];
+ m_client->dispatchDidCancelAuthenticationChallenge(activeDocumentLoader(), loader->identifier(), currentWebChallenge);
}
void FrameLoader::didReceiveResponse(WebResourceLoader* loader, NSURLResponse *r)
{
activeDocumentLoader()->addResponse(r);
- [m_client _incrementProgressForIdentifier:loader->identifier() response:r];
- [m_client _dispatchResource:loader->identifier() didReceiveResponse:r fromDocumentLoader:activeDocumentLoader()];
+ m_client->incrementProgress(loader->identifier(), r);
+ m_client->dispatchDidReceiveResponse(activeDocumentLoader(), loader->identifier(), r);
}
void FrameLoader::didReceiveData(WebResourceLoader* loader, NSData *data, int lengthReceived)
{
- [m_client _incrementProgressForIdentifier:loader->identifier() data:data];
- [m_client _dispatchResource:loader->identifier() didReceiveContentLength:lengthReceived fromDocumentLoader:activeDocumentLoader()];
+ m_client->incrementProgress(loader->identifier(), data);
+ m_client->dispatchDidReceiveContentLength(activeDocumentLoader(), loader->identifier(), lengthReceived);
}
void FrameLoader::didFinishLoad(WebResourceLoader* loader)
{
- [m_client _completeProgressForIdentifier:loader->identifier()];
- [m_client _dispatchResource:loader->identifier() didFinishLoadingFromDocumentLoader:activeDocumentLoader()];
+ m_client->completeProgress(loader->identifier());
+ m_client->dispatchDidFinishLoading(activeDocumentLoader(), loader->identifier());
}
void FrameLoader::didFailToLoad(WebResourceLoader* loader, NSError *error)
{
- [m_client _completeProgressForIdentifier:loader->identifier()];
+ m_client->completeProgress(loader->identifier());
if (error)
- [m_client _dispatchResource:loader->identifier() didFailLoadingWithError:error fromDocumentLoader:activeDocumentLoader()];
+ m_client->dispatchDidFailLoading(activeDocumentLoader(), loader->identifier(), error);
}
bool FrameLoader::privateBrowsingEnabled() const
{
- return [m_client _privateBrowsingEnabled];
+ return m_client->privateBrowsingEnabled();
}
NSURLRequest *FrameLoader::originalRequest() const
void FrameLoader::receivedMainResourceError(NSError *error, bool isComplete)
{
+ // Retain because the stop may release the last reference to it.
+ RefPtr<Frame> protect(m_frame);
+
RefPtr<DocumentLoader> loader = activeDocumentLoader();
- WebCoreFrameBridge *bridge = FrameLoader::bridge();
-
- // Retain the bridge because the stop may release the last reference to it.
- [bridge retain];
-
- id<WebFrameLoaderClient> cli = [m_client retain];
-
if (isComplete) {
// FIXME: Don't want to do this if an entirely new load is going, so should check
// that both data sources on the frame are either this or nil.
// Can't call _bridge because we might not have commited yet
- [bridge stop];
- if ([cli _shouldFallBackForError:error])
- [bridge handleFallbackContent];
+ m_frame->stop();
+ if (m_client->shouldFallBack(error))
+ [bridge() handleFallbackContent];
}
if (m_state == WebFrameStateProvisional) {
NSURL *failedURL = [m_provisionalDocumentLoader->originalRequestCopy() URL];
- [bridge didNotOpenURL:failedURL];
- [m_client _invalidateCurrentItemPageCache];
+ m_frame->didNotOpenURL(failedURL);
+ m_client->invalidateCurrentItemPageCache();
// Call clientRedirectCancelledOrFinished here so that the frame load delegate is notified that the redirect's
// status has changed, if there was a redirect. The frame load delegate may have saved some state about
loader->mainReceivedError(error, isComplete);
-
- [bridge release];
- [cli release];
}
void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress)
// Note that -webView:didCancelClientRedirectForFrame: is called on the frame load delegate even if
// the redirect succeeded. We should either rename this API, or add a new method, like
// -webView:didFinishClientRedirectForFrame:
- [m_client _dispatchDidCancelClientRedirectForFrame];
+ m_client->dispatchDidCancelClientRedirect();
if (!cancelWithLoadInProgress)
m_quickRedirectComing = false;
void FrameLoader::clientRedirected(NSURL *URL, double seconds, NSDate *date, bool lockHistory, bool isJavaScriptFormAction)
{
- [m_client _dispatchWillPerformClientRedirectToURL:URL delay:seconds fireDate:date];
+ m_client->dispatchWillPerformClientRedirect(URL, seconds, date);
// Remember that we sent a redirect notification to the frame load delegate so that when we commit
// the next provisional load, we can send a corresponding -webView:didCancelClientRedirectForFrame:
m_quickRedirectComing = false;
m_documentLoader->replaceRequestURLForAnchorScroll(URL);
- if (!isRedirect && ![m_client _shouldTreatURLAsSameAsCurrent:URL]) {
+ if (!isRedirect && !m_client->shouldTreatURLAsSameAsCurrent(URL)) {
// NB: must happen after _setURL, since we add based on the current request.
// Must also happen before we openURL and displace the scroll position, since
// adding the BF item will save away scroll state.
// we have already saved away the scroll and doc state for the long slow load,
// but it's not an obvious case.
- [m_client _addHistoryItemForFragmentScroll];
+ m_client->addHistoryItemForFragmentScroll();
}
- [bridge() scrollToAnchorWithURL:URL];
+ m_frame->scrollToAnchor(URL);
if (!isRedirect)
// This will clear previousItem from the rest of the frame tree that didn't
// we'll not go through a real load and reach Completed state.
checkLoadComplete();
- [m_client _dispatchDidChangeLocationWithinPageForFrame];
- [m_client _didFinishLoad];
+ m_client->dispatchDidChangeLocationWithinPage();
+ m_client->didFinishLoad();
}
void FrameLoader::closeOldDataSources()
// If so, add helpers for postorder traversal, and use them. If not, then lets not
// use a recursive algorithm here.
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
- child->frameLoader()->closeOldDataSources();
+ child->loader()->closeOldDataSources();
if (m_documentLoader)
- [m_client _dispatchWillCloseFrame];
+ m_client->dispatchWillClose();
- [m_client _setMainFrameDocumentReady:NO]; // stop giving out the actual DOMDocument to observers
+ m_client->setMainFrameDocumentReady(false); // stop giving out the actual DOMDocument to observers
}
void FrameLoader::opened()
{
if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect())
- [m_client _updateHistoryAfterClientRedirect];
+ m_client->updateHistoryAfterClientRedirect();
- if ([m_client _isDocumentLoaderLoadingFromPageCache:m_documentLoader.get()]) {
+ if (m_client->isLoadingFromPageCache(m_documentLoader.get())) {
// Force a layout to update view size and thereby update scrollbars.
- [m_client _forceLayout];
+ m_client->forceLayout();
const ResponseVector& responses = m_documentLoader->responses();
size_t count = responses.size();
[request release];
}
- [m_client _loadedFromPageCache];
+ m_client->loadedFromPageCache();
m_documentLoader->setPrimaryLoadComplete(true);
closeOldDataSources();
if (!pageCache)
- [m_client _makeRepresentationForDocumentLoader:pdl.get()];
+ m_client->makeRepresentation(pdl.get());
transitionToCommitted(pageCache);
void FrameLoader::download(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *response, id proxy)
{
- [m_client _downloadWithLoadingConnection:connection request:request response:response proxy:proxy];
+ m_client->download(connection, request, response, proxy);
}
WebCoreFrameBridge *FrameLoader::bridge() const
void FrameLoader::finishedLoading()
{
- RefPtr<DocumentLoader> dl = activeDocumentLoader();
-
- WebCoreFrameBridge *bridge = FrameLoader::bridge();
+ // Retain because the stop may release the last reference to it.
+ RefPtr<Frame> protect(m_frame);
- [bridge retain];
+ RefPtr<DocumentLoader> dl = activeDocumentLoader();
dl->finishedLoading();
-
- if (dl->mainDocumentError() || !dl->frameLoader()) {
- [bridge release];
+ if (dl->mainDocumentError() || !dl->frameLoader())
return;
- }
-
dl->setPrimaryLoadComplete(true);
- [m_client _dispatchDidLoadMainResourceForDocumentLoader:dl.get()];
+ m_client->dispatchDidLoadMainResource(dl.get());
checkLoadComplete();
-
- [bridge release];
}
void FrameLoader::notifyIconChanged(NSURL *iconURL)
NSImage *icon = [[WebCoreIconDatabaseBridge sharedInstance]
iconForPageURL:urlOriginalDataAsString(activeDocumentLoader()->URL())
withSize:NSMakeSize(16, 16)];
- [m_client _dispatchDidReceiveIcon:icon];
+ m_client->dispatchDidReceiveIcon(icon);
}
NSURL *FrameLoader::URL() const
NSError *FrameLoader::cancelledError(NSURLRequest *request) const
{
- return [m_client _cancelledErrorWithRequest:request];
+ return m_client->cancelledError(request);
}
NSError *FrameLoader::fileDoesNotExistError(NSURLResponse *response) const
{
- return [m_client _fileDoesNotExistErrorWithResponse:response];
+ return m_client->fileDoesNotExistError(response);
}
bool FrameLoader::willUseArchive(WebResourceLoader* loader, NSURLRequest *request, NSURL *originalURL) const
{
- return [m_client _willUseArchiveForRequest:request originalURL:originalURL loader:loader];
+ return m_client->willUseArchive(loader, request, originalURL);
}
bool FrameLoader::isArchiveLoadPending(WebResourceLoader* loader) const
{
- return [m_client _archiveLoadPendingForLoader:loader];
+ return m_client->isArchiveLoadPending(loader);
}
void FrameLoader::handleUnimplementablePolicy(NSError *error)
{
- m_delegateIsHandlingUnimplementablePolicy = YES;
- [m_client _dispatchUnableToImplementPolicyWithError:error];
- m_delegateIsHandlingUnimplementablePolicy = NO;
+ m_delegateIsHandlingUnimplementablePolicy = true;
+ m_client->dispatchUnableToImplementPolicy(error);
+ m_delegateIsHandlingUnimplementablePolicy = false;
}
void FrameLoader::cannotShowMIMEType(NSURLResponse *response)
{
- handleUnimplementablePolicy([m_client _cannotShowMIMETypeErrorWithResponse:response]);
+ handleUnimplementablePolicy(m_client->cannotShowMIMETypeError(response));
}
NSError *FrameLoader::interruptionForPolicyChangeError(NSURLRequest *request)
{
- return [m_client _interruptForPolicyChangeErrorWithRequest:request];
+ return m_client->interruptForPolicyChangeError(request);
}
bool FrameLoader::isHostedByObjectElement() const
bool FrameLoader::canShowMIMEType(NSString *MIMEType) const
{
- return [m_client _canShowMIMEType:MIMEType];
+ return m_client->canShowMIMEType(MIMEType);
}
bool FrameLoader::representationExistsForURLScheme(NSString *URLScheme)
{
- return [m_client _representationExistsForURLScheme:URLScheme];
+ return m_client->representationExistsForURLScheme(URLScheme);
}
NSString *FrameLoader::generatedMIMETypeForURLScheme(NSString *URLScheme)
{
- return [m_client _generatedMIMETypeForURLScheme:URLScheme];
+ return m_client->generatedMIMETypeForURLScheme(URLScheme);
}
void FrameLoader::checkNavigationPolicy(NSURLRequest *newRequest, id obj, SEL sel)
void FrameLoader::checkContentPolicy(NSString *MIMEType, id obj, SEL sel)
{
- WebPolicyDecider *d = [m_client _createPolicyDeciderWithTarget:obj action:sel];
+ WebPolicyDecider *d = m_client->createPolicyDecider(obj, sel);
m_policyDecider = d;
- [m_client _dispatchDecidePolicyForMIMEType:MIMEType request:activeDocumentLoader()->request() decider:d];
+ m_client->dispatchDecidePolicyForMIMEType(d, MIMEType, activeDocumentLoader()->request());
[d release];
}
[request setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
- RefPtr<DocumentLoader> loader = [m_client _createDocumentLoaderWithRequest:request];
+ RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request);
setPolicyDocumentLoader(loader.get());
[request release];
if (unreachableURL != nil)
initialRequest = [NSURLRequest requestWithURL:unreachableURL];
- RefPtr<DocumentLoader> loader = [m_client _createDocumentLoaderWithRequest:initialRequest];
+ RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(initialRequest);
setPolicyDocumentLoader(loader.get());
NSMutableURLRequest *request = loader->request();
void FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame()
{
- [m_client _dispatchDidReceiveServerRedirectForProvisionalLoadForFrame];
+ m_client->dispatchDidReceiveServerRedirectForProvisionalLoad();
}
void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
{
- [m_client _finishedLoadingDocument:loader];
+ m_client->finishedLoading(loader);
}
void FrameLoader::committedLoad(DocumentLoader* loader, NSData *data)
{
- [m_client _committedLoadWithDocumentLoader:loader data:data];
+ m_client->committedLoad(loader, data);
}
bool FrameLoader::isReplacing() const
void FrameLoader::revertToProvisional(DocumentLoader* loader)
{
- [m_client _revertToProvisionalStateForDocumentLoader:loader];
+ m_client->revertToProvisionalState(loader);
}
void FrameLoader::setMainDocumentError(DocumentLoader* loader, NSError *error)
{
- [m_client _setMainDocumentError:error forDocumentLoader:loader];
+ m_client->setMainDocumentError(loader, error);
}
void FrameLoader::mainReceivedCompleteError(DocumentLoader* loader, NSError *error)
{
loader->setPrimaryLoadComplete(true);
- [m_client _dispatchDidLoadMainResourceForDocumentLoader:activeDocumentLoader()];
+ m_client->dispatchDidLoadMainResource(activeDocumentLoader());
checkLoadComplete();
}
{
// It's most likely that the last added frame is the last to load so we walk backwards.
for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree()->previousSibling()) {
- FrameLoader* childLoader = child->frameLoader();
+ FrameLoader* childLoader = child->loader();
DocumentLoader* documentLoader = childLoader->documentLoader();
if (documentLoader && documentLoader->isLoadingInAPISense())
return true;
void FrameLoader::willChangeTitle(DocumentLoader* loader)
{
- [m_client _willChangeTitleForDocument:loader];
+ m_client->willChangeTitle(loader);
}
void FrameLoader::didChangeTitle(DocumentLoader* loader)
{
- [m_client _didChangeTitleForDocument:loader];
+ m_client->didChangeTitle(loader);
// The title doesn't get communicated to the WebView until we are committed.
if (loader->isCommitted())
if (NSURL *URLForHistory = canonicalURL(loader->URLForHistory())) {
// Must update the entries in the back-forward list too.
// This must go through the WebFrame because it has the right notion of the current b/f item.
- [m_client _setTitle:loader->title() forURL:URLForHistory];
- [m_client _setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
- [m_client _dispatchDidReceiveTitle:loader->title()];
+ m_client->setTitle(loader->title(), URLForHistory);
+ m_client->setMainFrameDocumentReady(true); // update observers with new DOMDocument
+ m_client->dispatchDidReceiveTitle(loader->title());
}
}
void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *action,
NSString *frameName, PassRefPtr<FormState> formState)
{
- WebPolicyDecider *decider = [m_client _createPolicyDeciderWithTarget:asDelegate()
- action:@selector(continueAfterNewWindowPolicy:)];
+ WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(),
+ @selector(continueAfterNewWindowPolicy:));
m_policyRequest = request;
m_policyTarget = asDelegate();
m_policyDecider = decider;
m_policyFormState = formState;
- [m_client _dispatchDecidePolicyForNewWindowAction:action request:request
- newFrameName:frameName decider:decider];
+ m_client->dispatchDecidePolicyForNewWindowAction(decider, action, request, frameName);
[decider release];
}
request = nil;
break;
case WebPolicyDownload:
- [m_client _startDownloadWithRequest:request.get()];
+ m_client->startDownload(request.get());
request = nil;
break;
case WebPolicyUse:
loader->setLastCheckedRequest(request);
- WebPolicyDecider *decider = [m_client _createPolicyDeciderWithTarget:asDelegate()
- action:@selector(continueAfterNavigationPolicy:)];
+ WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(),
+ @selector(continueAfterNavigationPolicy:));
m_policyRequest = request;
m_policyTarget = target;
m_policyFormState = formState;
m_delegateIsDecidingNavigationPolicy = true;
- [m_client _dispatchDecidePolicyForNavigationAction:action request:request decider:decider];
+ m_client->dispatchDecidePolicyForNavigationAction(decider, action, request);
m_delegateIsDecidingNavigationPolicy = false;
[decider release];
request = nil;
break;
case WebPolicyDownload:
- [m_client _startDownloadWithRequest:request.get()];
+ m_client->startDownload(request.get());
request = nil;
break;
case WebPolicyUse:
- if (![m_client _canHandleRequest:request.get()]) {
- handleUnimplementablePolicy([m_client _cannotShowURLErrorWithRequest:request.get()]);
+ if (!m_client->canHandleRequest(request.get())) {
+ handleUnimplementablePolicy(m_client->cannotShowURLError(request.get()));
request = nil;
}
break;
// through this method already, nested; otherwise, policyDataSource should still be set.
ASSERT(m_policyDocumentLoader || m_provisionalDocumentLoader->unreachableURL());
- BOOL isTargetItem = [m_client _provisionalItemIsTarget];
+ BOOL isTargetItem = m_client->provisionalItemIsTarget();
// Two reasons we can't continue:
// 1) Navigation policy delegate said we can't so request is nil. A primary case of this
// problem that we have optimistically moved the b/f cursor already, so move it back. For sanity,
// we only do this when punting a navigation for the target frame or top-level frame.
if ((isTargetItem || isLoadingMainFrame()) && isBackForwardLoadType(m_policyLoadType))
- [m_client _resetBackForwardList];
+ m_client->resetBackForwardList();
return;
}
setPolicyDocumentLoader(0);
- if (isBackForwardLoadType(type) && [m_client _loadProvisionalItemFromPageCache])
+ if (isBackForwardLoadType(type) && m_client->loadProvisionalItemFromPageCache())
return;
if (formState) {
// It's a bit of a hack to reuse the WebPolicyDecisionListener for the continuation
// mechanism across the willSubmitForm callout.
- WebPolicyDecider *decider = [m_client _createPolicyDeciderWithTarget:asDelegate() action:@selector(continueAfterWillSubmitForm:)];
+ WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(), @selector(continueAfterWillSubmitForm:));
m_policyDecider = decider;
- [m_client _dispatchSourceFrame:Mac(formState->sourceFrame())->bridge()
- willSubmitForm:[DOMElement _elementWith:formState->form()]
- withValues:formState->valuesAsNSDictionary() submissionDecider:decider];
+ m_client->dispatchWillSubmitForm(decider, formState->sourceFrame(), formState->form(), formState->valuesAsNSDictionary());
[decider release];
} else
continueAfterWillSubmitForm(WebPolicyUse);
void FrameLoader::didFirstLayout()
{
- if (isBackForwardLoadType(m_loadType) && [m_client _hasBackForwardList])
- [m_client _restoreScrollPositionAndViewState];
+ if (isBackForwardLoadType(m_loadType) && m_client->hasBackForwardList())
+ m_client->restoreScrollPositionAndViewState();
m_firstLayoutDone = true;
- [m_client _dispatchDidFirstLayoutInFrame];
+ m_client->dispatchDidFirstLayout();
}
void FrameLoader::frameLoadCompleted()
{
- [m_client _frameLoadCompleted];
+ m_client->frameLoadCompleted();
// After a canceled provisional load, firstLayoutDone is false.
- // Reset it to YES if we're displaying a page.
+ // Reset it to true if we're displaying a page.
if (m_documentLoader)
m_firstLayoutDone = true;
}
void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
{
- ASSERT([m_client _hasWebView]);
+ ASSERT(m_client->hasWebView());
ASSERT(m_state == WebFrameStateProvisional);
if (m_state != WebFrameStateProvisional)
return;
- [m_client _setCopiesOnScroll];
- [m_client _updateHistoryForCommit];
+ m_client->setCopiesOnScroll();
+ m_client->updateHistoryForCommit();
// The call to closeURL invokes the unload event handler, which can execute arbitrary
// JavaScript. If the script initiates a new load, we need to abandon the current load,
case FrameLoadTypeForward:
case FrameLoadTypeBack:
case FrameLoadTypeIndexedBackForward:
- if ([m_client _hasBackForwardList]) {
- [m_client _updateHistoryForBackForwardNavigation];
+ if (m_client->hasBackForwardList()) {
+ m_client->updateHistoryForBackForwardNavigation();
// Create a document view for this document, or used the cached view.
if (pageCache)
- [m_client _setDocumentViewFromPageCache:pageCache];
+ m_client->setDocumentViewFromPageCache(pageCache);
else
- [m_client _makeDocumentView];
+ m_client->makeDocumentView();
}
break;
case FrameLoadTypeReload:
case FrameLoadTypeSame:
case FrameLoadTypeReplace:
- [m_client _updateHistoryForReload];
- [m_client _makeDocumentView];
+ m_client->updateHistoryForReload();
+ m_client->makeDocumentView();
break;
// FIXME - just get rid of this case, and merge FrameLoadTypeReloadAllowingStaleData with the above case
case FrameLoadTypeReloadAllowingStaleData:
- [m_client _makeDocumentView];
+ m_client->makeDocumentView();
break;
case FrameLoadTypeStandard:
- [m_client _updateHistoryForStandardLoad];
- [m_client _makeDocumentView];
+ m_client->updateHistoryForStandardLoad();
+ m_client->makeDocumentView();
break;
case FrameLoadTypeInternal:
- [m_client _updateHistoryForInternalLoad];
- [m_client _makeDocumentView];
+ m_client->updateHistoryForInternalLoad();
+ m_client->makeDocumentView();
break;
// FIXME Remove this check when dummy ds is removed (whatever "dummy ds" is).
}
// Tell the client we've committed this URL.
- ASSERT([m_client _hasFrameView]);
- [m_client _dispatchDidCommitLoadForFrame];
+ ASSERT(m_client->hasFrameView());
+ m_client->dispatchDidCommitLoad();
// If we have a title let the WebView know about it.
if (ptitle)
- [m_client _dispatchDidReceiveTitle:ptitle];
+ m_client->dispatchDidReceiveTitle(ptitle);
}
void FrameLoader::checkLoadCompleteForThisFrame()
{
- ASSERT([m_client _hasWebView]);
+ ASSERT(m_client->hasWebView());
switch (m_state) {
case WebFrameStateProvisional: {
return;
// Check all children first.
- LoadErrorResetToken *resetToken = [m_client _tokenForLoadErrorReset];
+ LoadErrorResetToken *resetToken = m_client->tokenForLoadErrorReset();
bool shouldReset = true;
if (!pdl->isLoadingInAPISense()) {
m_delegateIsHandlingProvisionalLoadError = true;
- [m_client _dispatchDidFailProvisionalLoadWithError:error];
+ m_client->dispatchDidFailProvisionalLoad(error);
m_delegateIsHandlingProvisionalLoadError = false;
// FIXME: can stopping loading here possibly have any effect, if isLoading is false,
}
}
if (shouldReset)
- [m_client _resetAfterLoadError:resetToken];
+ m_client->resetAfterLoadError(resetToken);
else
- [m_client _doNotResetAfterLoadError:resetToken];
+ m_client->doNotResetAfterLoadError(resetToken);
return;
}
// Maybe there are bugs because of that, or extra work we can skip because
// the new page is ready.
- [m_client _forceLayoutForNonHTML];
+ m_client->forceLayoutForNonHTML();
// If the user had a scroll point, scroll to it, overriding the anchor point if any.
if ((isBackForwardLoadType(m_loadType) || m_loadType == FrameLoadTypeReload)
- && [m_client _hasBackForwardList])
- [m_client _restoreScrollPositionAndViewState];
+ && m_client->hasBackForwardList())
+ m_client->restoreScrollPositionAndViewState();
NSError *error = dl->mainDocumentError();
if (error)
- [m_client _dispatchDidFailLoadWithError:error];
+ m_client->dispatchDidFailLoad(error);
else
- [m_client _dispatchDidFinishLoadForFrame];
+ m_client->dispatchDidFinishLoad();
- [m_client _progressCompleted];
+ m_client->progressCompleted();
return;
}
case WebFrameStateComplete:
// Even if already complete, we might have set a previous item on a frame that
// didn't do any data loading on the past transaction. Make sure to clear these out.
- [m_client _frameLoadCompleted];
+ m_client->frameLoadCompleted();
return;
}
RefPtr<Frame> frame = m_frame;
- WebCoreFrameBridge *mainBridge = [m_client _dispatchCreateWebViewWithRequest:nil];
- if (!mainBridge)
+ RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(nil);
+ if (!mainFrame)
return;
- [mainBridge retain];
-
- [mainBridge setName:frameName];
- [[mainBridge impl]->frameLoader()->client() _dispatchShow];
- [mainBridge impl]->setOpener(frame.get());
- [mainBridge impl]->frameLoader()->load(request, nil, FrameLoadTypeStandard, formState);
-
- [mainBridge release];
+ [Mac(mainFrame.get())->bridge() setName:frameName];
+ mainFrame->loader()->client()->dispatchShow();
+ mainFrame->setOpener(frame.get());
+ mainFrame->loader()->load(request, nil, FrameLoadTypeStandard, formState);
}
void FrameLoader::sendRemainingDelegateMessages(id identifier, NSURLResponse *response, unsigned length, NSError *error)
{
if (response)
- [m_client _dispatchResource:identifier didReceiveResponse:response fromDocumentLoader:m_documentLoader.get()];
+ m_client->dispatchDidReceiveResponse(m_documentLoader.get(), identifier, response);
if (length > 0)
- [m_client _dispatchResource:identifier didReceiveContentLength:length fromDocumentLoader:m_documentLoader.get()];
+ m_client->dispatchDidReceiveContentLength(m_documentLoader.get(), identifier, length);
if (!error)
- [m_client _dispatchResource:identifier didFinishLoadingFromDocumentLoader:m_documentLoader.get()];
+ m_client->dispatchDidFinishLoading(m_documentLoader.get(), identifier);
else
- [m_client _dispatchResource:identifier didFailLoadingWithError:error fromDocumentLoader:m_documentLoader.get()];
+ m_client->dispatchDidFailLoading(m_documentLoader.get(), identifier, error);
}
NSURLRequest *FrameLoader::requestFromDelegate(NSURLRequest *request, id& identifier, NSError *& error)
{
ASSERT(request != nil);
- identifier = [m_client _dispatchIdentifierForInitialRequest:request fromDocumentLoader:m_documentLoader.get()];
- NSURLRequest *newRequest = [m_client _dispatchResource:identifier
- willSendRequest:request redirectResponse:nil fromDocumentLoader:m_documentLoader.get()];
+ identifier = m_client->dispatchIdentifierForInitialRequest(m_documentLoader.get(), request);
+ NSURLRequest *newRequest = m_client->dispatchWillSendRequest(m_documentLoader.get(), identifier, request, nil);
if (newRequest == nil)
- error = [m_client _cancelledErrorWithRequest:request];
+ error = m_client->cancelledError(request);
else
error = nil;
if (target != nil) {
Frame* targetFrame = m_frame->tree()->find(target);
if (targetFrame)
- targetFrame->frameLoader()->load(request, action, FrameLoadTypeStandard, formState.release());
+ targetFrame->loader()->load(request, action, FrameLoadTypeStandard, formState.release());
else
checkNewWindowPolicy(request, action, target, formState.release());
} else
Frame* previous;
for (Frame* child = m_frame->tree()->lastChild(); child; child = previous) {
previous = child->tree()->previousSibling();
- child->frameLoader()->detachFromParent();
+ child->loader()->detachFromParent();
}
}
void FrameLoader::detachFromParent()
{
- WebCoreFrameBridge *bridge = [FrameLoader::bridge() retain];
- id <WebFrameLoaderClient> client = [m_client retain];
+ RefPtr<Frame> protect(m_frame);
- [bridge closeURL];
+ [bridge() closeURL];
stopLoading();
- [client _detachedFromParent1];
+ m_client->detachedFromParent1();
detachChildren();
- [client _detachedFromParent2];
+ m_client->detachedFromParent2();
setDocumentLoader(0);
- [client _detachedFromParent3];
+ m_client->detachedFromParent3();
if (Frame* parent = m_frame->tree()->parent())
parent->tree()->removeChild(m_frame);
- [bridge close];
- [client _detachedFromParent4];
-
- [client release];
- [bridge release];
+ [bridge() close];
+ m_client->detachedFromParent4();
}
void FrameLoader::addExtraFieldsToRequest(NSMutableURLRequest *request, bool mainResource, bool alwaysFromRequest)
if (mainResource && (isLoadingMainFrame() || alwaysFromRequest))
[request setMainDocumentURL:[request URL]];
else
- [request setMainDocumentURL:[m_client _mainFrameURL]];
+ [request setMainDocumentURL:m_client->mainFrameURL()];
}
if (mainResource)
NSString *ActionButtonKey = @"WebActionButtonKey";
NSString *ActionModifierFlagsKey = @"WebActionModifierFlagsKey";
NSString *ActionOriginalURLKey = @"WebActionOriginalURLKey";
- NSDictionary *elementInfo = [m_client _elementForEvent:event];
+ NSDictionary *elementInfo = m_client->elementForEvent(event);
if (elementInfo)
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:navigationType], ActionNavigationTypeKey,
// Called every time a resource is completely loaded, or an error is received.
void FrameLoader::checkLoadComplete()
{
- ASSERT([m_client _hasWebView]);
+ ASSERT(m_client->hasWebView());
for (RefPtr<Frame> frame = m_frame; frame; frame = frame->tree()->parent())
- frame->frameLoader()->checkLoadCompleteForThisFrame();
+ frame->loader()->checkLoadCompleteForThisFrame();
}
-void FrameLoader::setFrameLoaderClient(id <WebFrameLoaderClient> client)
+void FrameLoader::setClient(FrameLoaderClient* client)
{
+ ASSERT(client);
+ ASSERT(!m_client);
m_client = client;
}
-id <WebFrameLoaderClient> FrameLoader::client() const
+FrameLoaderClient* FrameLoader::client() const
{
return m_client;
}
return m_asDelegate.get();
}
+FrameLoaderClient::~FrameLoaderClient()
+{
+}
+
}
@implementation WebCoreFrameLoaderAsDelegate
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Cocoa/Cocoa.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Forward.h>
+
+@class WebPolicyDecider;
namespace WebCore {
+
class DocumentLoader;
+ class Element;
+ class Frame;
class WebResourceLoader;
-}
-typedef struct LoadErrorResetToken LoadErrorResetToken;
+ struct LoadErrorResetToken;
-@class DOMElement;
-@class WebCoreFrameBridge;
-@class WebPolicyDecider;
-@class WebResource;
+ class FrameLoaderClient : Noncopyable {
+ public:
+ virtual void detachFrameLoader() = 0;
-@protocol WebFrameLoaderClient <NSObject>
+ virtual bool hasWebView() const = 0; // mainly for assertions
+ virtual bool hasFrameView() const = 0; // ditto
-- (BOOL)_hasWebView; // mainly for assertions
-- (BOOL)_hasFrameView; // ditto
+ virtual bool hasBackForwardList() const = 0;
+ virtual void resetBackForwardList() = 0;
-- (BOOL)_hasBackForwardList;
-- (void)_resetBackForwardList;
+ virtual bool provisionalItemIsTarget() const = 0;
+ virtual bool loadProvisionalItemFromPageCache() = 0;
+ virtual void invalidateCurrentItemPageCache() = 0;
-- (BOOL)_provisionalItemIsTarget;
-- (BOOL)_loadProvisionalItemFromPageCache;
-- (void)_invalidateCurrentItemPageCache;
+ virtual bool privateBrowsingEnabled() const = 0;
-- (BOOL)_privateBrowsingEnabled;
+ virtual void makeDocumentView() = 0;
+ virtual void makeRepresentation(DocumentLoader*) = 0;
+ virtual void setDocumentViewFromPageCache(NSDictionary *) = 0;
+ virtual void forceLayout() = 0;
+ virtual void forceLayoutForNonHTML() = 0;
-- (void)_makeDocumentView;
-- (void)_makeRepresentationForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_setDocumentViewFromPageCache:(NSDictionary *)dictionary;
-- (void)_forceLayout;
-- (void)_forceLayoutForNonHTML;
+ virtual void updateHistoryForCommit() = 0;
-- (void)_updateHistoryForCommit;
+ virtual void updateHistoryForBackForwardNavigation() = 0;
+ virtual void updateHistoryForReload() = 0;
+ virtual void updateHistoryForStandardLoad() = 0;
+ virtual void updateHistoryForInternalLoad() = 0;
-- (void)_updateHistoryForBackForwardNavigation;
-- (void)_updateHistoryForReload;
-- (void)_updateHistoryForStandardLoad;
-- (void)_updateHistoryForInternalLoad;
+ virtual void updateHistoryAfterClientRedirect() = 0;
-- (void)_updateHistoryAfterClientRedirect;
+ virtual void setCopiesOnScroll() = 0;
-- (void)_setCopiesOnScroll;
+ virtual LoadErrorResetToken* tokenForLoadErrorReset() = 0;
+ virtual void resetAfterLoadError(LoadErrorResetToken*) = 0;
+ virtual void doNotResetAfterLoadError(LoadErrorResetToken*) = 0;
-- (LoadErrorResetToken *)_tokenForLoadErrorReset;
-- (void)_resetAfterLoadError:(LoadErrorResetToken *)token;
-- (void)_doNotResetAfterLoadError:(LoadErrorResetToken *)token;
+ virtual void detachedFromParent1() = 0;
+ virtual void detachedFromParent2() = 0;
+ virtual void detachedFromParent3() = 0;
+ virtual void detachedFromParent4() = 0;
-- (void)_detachedFromParent1;
-- (void)_detachedFromParent2;
-- (void)_detachedFromParent3;
-- (void)_detachedFromParent4;
+ virtual void loadedFromPageCache() = 0;
-- (void)_loadedFromPageCache;
+ virtual void download(NSURLConnection *, NSURLRequest *, NSURLResponse *, id proxy) = 0;
-- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy;
+ virtual id dispatchIdentifierForInitialRequest(DocumentLoader*, NSURLRequest *) = 0;
+ virtual NSURLRequest *dispatchWillSendRequest(DocumentLoader*, id identifier, NSURLRequest *, NSURLResponse *redirectResponse) = 0;
+ virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, id identifier, NSURLAuthenticationChallenge *) = 0;
+ virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, id identifier, NSURLAuthenticationChallenge *) = 0;
+ virtual void dispatchDidReceiveResponse(DocumentLoader*, id identifier, NSURLResponse *) = 0;
+ virtual void dispatchDidReceiveContentLength(DocumentLoader*, id identifier, int lengthReceived) = 0;
+ virtual void dispatchDidFinishLoading(DocumentLoader*, id identifier) = 0;
+ virtual void dispatchDidFailLoading(DocumentLoader*, id identifier, NSError *) = 0;
-- (id)_dispatchIdentifierForInitialRequest:(NSURLRequest *)request fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (NSURLRequest *)_dispatchResource:(id)identifier willSendRequest:(NSURLRequest *)clientRequest redirectResponse:(NSURLResponse *)redirectResponse fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchDidReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchDidCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didReceiveResponse:(NSURLResponse *)r fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didReceiveContentLength:(int)lengthReceived fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didFinishLoadingFromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didFailLoadingWithError:error fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+ virtual void dispatchDidHandleOnloadEvents() = 0;
+ virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
+ virtual void dispatchDidCancelClientRedirect() = 0;
+ virtual void dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval, NSDate *) = 0;
+ virtual void dispatchDidChangeLocationWithinPage() = 0;
+ virtual void dispatchWillClose() = 0;
+ virtual void dispatchDidReceiveIcon(NSImage *) = 0;
+ virtual void dispatchDidStartProvisionalLoad() = 0;
+ virtual void dispatchDidReceiveTitle(NSString *title) = 0;
+ virtual void dispatchDidCommitLoad() = 0;
+ virtual void dispatchDidFailProvisionalLoad(NSError *) = 0;
+ virtual void dispatchDidFailLoad(NSError *) = 0;
+ virtual void dispatchDidFinishLoad() = 0;
+ virtual void dispatchDidFirstLayout() = 0;
-- (void)_dispatchDidHandleOnloadEventsForFrame;
-- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
-- (void)_dispatchDidCancelClientRedirectForFrame;
-- (void)_dispatchWillPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
-- (void)_dispatchDidChangeLocationWithinPageForFrame;
-- (void)_dispatchWillCloseFrame;
-- (void)_dispatchDidReceiveIcon:(NSImage *)icon;
-- (void)_dispatchDidStartProvisionalLoadForFrame;
-- (void)_dispatchDidReceiveTitle:(NSString *)title;
-- (void)_dispatchDidCommitLoadForFrame;
-- (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error;
-- (void)_dispatchDidFailLoadWithError:(NSError *)error;
-- (void)_dispatchDidFinishLoadForFrame;
-- (void)_dispatchDidFirstLayoutInFrame;
+ virtual Frame* dispatchCreatePage(NSURLRequest *) = 0;
+ virtual void dispatchShow() = 0;
-- (WebCoreFrameBridge *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
-- (void)_dispatchShow;
+ virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *) = 0;
+ virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName) = 0;
+ virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *) = 0;
+ virtual void dispatchUnableToImplementPolicy(NSError *) = 0;
-- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
-- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decider:(WebPolicyDecider *)decider;
-- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
-- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error;
+ virtual void dispatchWillSubmitForm(WebPolicyDecider *, Frame* sourceFrame, Element* form, NSDictionary *values) = 0;
-- (void)_dispatchSourceFrame:(WebCoreFrameBridge *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider;
+ virtual void dispatchDidLoadMainResource(DocumentLoader*) = 0;
+ virtual void clearLoadingFromPageCache(DocumentLoader*) = 0;
+ virtual bool isLoadingFromPageCache(DocumentLoader*) = 0;
+ virtual void revertToProvisionalState(DocumentLoader*) = 0;
+ virtual void setMainDocumentError(DocumentLoader*, NSError *) = 0;
+ virtual void clearUnarchivingState(DocumentLoader*) = 0;
-- (void)_dispatchDidLoadMainResourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_clearLoadingFromPageCacheForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebCore::DocumentLoader*)loader;
-- (void)_revertToProvisionalStateForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_setMainDocumentError:(NSError *)error forDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_clearUnarchivingStateForLoader:(WebCore::DocumentLoader*)loader;
+ virtual void progressStarted() = 0;
+ virtual void progressCompleted() = 0;
-- (void)_progressStarted;
-- (void)_progressCompleted;
+ virtual void incrementProgress(id identifier, NSURLResponse *) = 0;
+ virtual void incrementProgress(id identifier, NSData *) = 0;
+ virtual void completeProgress(id identifier) = 0;
-- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response;
-- (void)_incrementProgressForIdentifier:(id)identifier data:(NSData *)data;
-- (void)_completeProgressForIdentifier:(id)identifier;
+ virtual void setMainFrameDocumentReady(bool) = 0;
-- (void)_setMainFrameDocumentReady:(BOOL)ready;
+ virtual void startDownload(NSURLRequest *) = 0;
-- (void)_startDownloadWithRequest:(NSURLRequest *)request;
+ virtual void willChangeTitle(DocumentLoader*) = 0;
+ virtual void didChangeTitle(DocumentLoader*) = 0;
-- (void)_willChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
-- (void)_didChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
+ virtual void committedLoad(DocumentLoader*, NSData *) = 0;
+ virtual void finishedLoading(DocumentLoader*) = 0;
+ virtual void finalSetupForReplace(DocumentLoader*) = 0;
-- (void)_committedLoadWithDocumentLoader:(WebCore::DocumentLoader*)loader data:(NSData *)data;
-- (void)_finishedLoadingDocument:(WebCore::DocumentLoader*)loader;
-- (void)_documentLoader:(WebCore::DocumentLoader*)loader setMainDocumentError:(NSError *)error;
-- (void)_finalSetupForReplaceWithDocumentLoader:(WebCore::DocumentLoader*)loader;
+ virtual NSError *cancelledError(NSURLRequest *) = 0;
+ virtual NSError *cannotShowURLError(NSURLRequest *) = 0;
+ virtual NSError *interruptForPolicyChangeError(NSURLRequest *) = 0;
-- (NSError *)_cancelledErrorWithRequest:(NSURLRequest *)request;
-- (NSError *)_cannotShowURLErrorWithRequest:(NSURLRequest *)request;
-- (NSError *)_interruptForPolicyChangeErrorWithRequest:(NSURLRequest *)request;
+ virtual NSError *cannotShowMIMETypeError(NSURLResponse *) = 0;
+ virtual NSError *fileDoesNotExistError(NSURLResponse *) = 0;
-- (NSError *)_cannotShowMIMETypeErrorWithResponse:(NSURLResponse *)response;
-- (NSError *)_fileDoesNotExistErrorWithResponse:(NSURLResponse *)response;
+ virtual bool shouldFallBack(NSError *) = 0;
-- (BOOL)_shouldFallBackForError:(NSError *)error;
+ virtual NSURL *mainFrameURL() = 0;
-- (NSURL *)_mainFrameURL;
-
-- (void)_setDefersCallbacks:(BOOL)defers;
+ virtual void setDefersCallbacks(bool) = 0;
-- (BOOL)_willUseArchiveForRequest:(NSURLRequest *)request originalURL:(NSURL *)originalURL loader:(WebCore::WebResourceLoader *)loader;
-- (BOOL)_archiveLoadPendingForLoader:(WebCore::WebResourceLoader *)loader;
-- (void)_cancelPendingArchiveLoadForLoader:(WebCore::WebResourceLoader *)loader;
-- (void)_clearArchivedResources;
+ virtual bool willUseArchive(WebResourceLoader*, NSURLRequest *, NSURL *originalURL) const = 0;
+ virtual bool isArchiveLoadPending(WebResourceLoader*) const = 0;
+ virtual void cancelPendingArchiveLoad(WebResourceLoader*) = 0;
+ virtual void clearArchivedResources() = 0;
-- (BOOL)_canHandleRequest:(NSURLRequest *)request;
-- (BOOL)_canShowMIMEType:(NSString *)MIMEType;
-- (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
-- (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
+ virtual bool canHandleRequest(NSURLRequest *) const = 0;
+ virtual bool canShowMIMEType(NSString *MIMEType) const = 0;
+ virtual bool representationExistsForURLScheme(NSString *URLScheme) const = 0;
+ virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const = 0;
-- (NSDictionary *)_elementForEvent:(NSEvent *)event;
+ virtual NSDictionary *elementForEvent(NSEvent *) const = 0;
-- (WebPolicyDecider *)_createPolicyDeciderWithTarget:(id)obj action:(SEL)selector;
-
-- (void)_frameLoadCompleted;
-- (void)_restoreScrollPositionAndViewState;
-- (void)_provisionalLoadStarted;
- // used to decide to use loadType=Same
-- (BOOL)_shouldTreatURLAsSameAsCurrent:(NSURL *)URL;
-- (void)_addHistoryItemForFragmentScroll;
-- (void)_didFinishLoad;
-- (void)_prepareForDataSourceReplacement;
-- (PassRefPtr<WebCore::DocumentLoader>)_createDocumentLoaderWithRequest:(NSURLRequest *)request;
-- (void)_setTitle:(NSString *)title forURL:(NSURL *)URL;
-
-@end
+ virtual WebPolicyDecider *createPolicyDecider(id object, SEL selector) = 0;
+
+ virtual void frameLoadCompleted() = 0;
+ virtual void restoreScrollPositionAndViewState() = 0;
+ virtual void provisionalLoadStarted() = 0;
+ virtual bool shouldTreatURLAsSameAsCurrent(NSURL *) const = 0;
+ virtual void addHistoryItemForFragmentScroll() = 0;
+ virtual void didFinishLoad() = 0;
+ virtual void prepareForDataSourceReplacement() = 0;
+ virtual PassRefPtr<DocumentLoader> createDocumentLoader(NSURLRequest *) = 0;
+ virtual void setTitle(NSString *title, NSURL *URL) = 0;
+
+ protected:
+ virtual ~FrameLoaderClient();
+ };
+
+}
{
if (!m_frame)
return 0;
- return m_frame->frameLoader();
+ return m_frame->loader();
}
void WebResourceLoader::addData(NSData *data, bool allAtOnce)
id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader,
NSMutableURLRequest *newRequest, NSString *method, NSDictionary *customHeaders, NSString *referrer)
{
- FrameLoader* fl = frame->frameLoader();
+ FrameLoader* fl = frame->loader();
if (fl->state() == WebFrameStateProvisional)
return nil;
#pragma mark END LOADING FUNCTIONS
-FrameLoader* Frame::frameLoader()
+FrameLoader* Frame::loader() const
{
return d->m_frameLoader;
}
virtual void urlSelected(const ResourceRequest&, const String& target, const Event* triggeringEvent, bool lockHistory = false);
virtual void urlSelected(const FrameLoadRequest&, const Event* triggeringEvent) = 0;
- FrameLoader* frameLoader();
-
bool requestFrame(Element* ownerElement, const String& url, const AtomicString& frameName);
virtual Frame* createFrame(const KURL& url, const String& name, Element* ownerElement, const String& referrer) = 0;
Frame* loadSubframe(Element* ownerElement, const KURL& url, const String& name, const String& referrer);
DOMWindow* domWindow() const;
Editor* editor() const;
CommandByName* command() const;
+ FrameLoader* loader() const;
+
private:
friend class FramePrivate;
FramePrivate* d;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(this);
- if (!bridge || ![bridge impl] || ![bridge impl]->tabsToAllControls()) {
+ if (!bridge || ![bridge _frame] || ![bridge _frame]->tabsToAllControls())
return NoFocus;
- }
END_BLOCK_OBJC_EXCEPTIONS;
+2006-10-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Anders.
+
+ - converted WebFrameLoaderClient to C++
+ - renamed frame->frameLoader() function to frame->loader()
+ - renamed [bridge impl] to [bridge _frame]
+ - removed some bridge methods
+
+ * Plugins/WebNetscapePluginStream.mm:
+ * WebCoreSupport/WebEditorClient.mm:
+ * WebCoreSupport/WebFrameLoaderClient.h: Added.
+ (WebFrameLoaderClient::webFrame):
+ * WebCoreSupport/WebFrameLoaderClient.mm: Added.
+ (WebFrameLoaderClient::detachFrameLoader):
+ (WebFrameLoaderClient::hasWebView):
+ (WebFrameLoaderClient::hasFrameView):
+ (WebFrameLoaderClient::hasBackForwardList):
+ (WebFrameLoaderClient::resetBackForwardList):
+ (WebFrameLoaderClient::provisionalItemIsTarget):
+ (WebFrameLoaderClient::loadProvisionalItemFromPageCache):
+ (WebFrameLoaderClient::invalidateCurrentItemPageCache):
+ (WebFrameLoaderClient::privateBrowsingEnabled):
+ (WebFrameLoaderClient::makeDocumentView):
+ (WebFrameLoaderClient::makeRepresentation):
+ (WebFrameLoaderClient::setDocumentViewFromPageCache):
+ (WebFrameLoaderClient::forceLayout):
+ (WebFrameLoaderClient::forceLayoutForNonHTML):
+ (WebFrameLoaderClient::updateHistoryForCommit):
+ (WebFrameLoaderClient::updateHistoryForBackForwardNavigation):
+ (WebFrameLoaderClient::updateHistoryForReload):
+ (WebFrameLoaderClient::updateHistoryForStandardLoad):
+ (WebFrameLoaderClient::updateHistoryForInternalLoad):
+ (WebFrameLoaderClient::updateHistoryAfterClientRedirect):
+ (WebFrameLoaderClient::setCopiesOnScroll):
+ (WebFrameLoaderClient::tokenForLoadErrorReset):
+ (WebFrameLoaderClient::resetAfterLoadError):
+ (WebFrameLoaderClient::doNotResetAfterLoadError):
+ (WebFrameLoaderClient::detachedFromParent1):
+ (WebFrameLoaderClient::detachedFromParent2):
+ (WebFrameLoaderClient::detachedFromParent3):
+ (WebFrameLoaderClient::detachedFromParent4):
+ (WebFrameLoaderClient::loadedFromPageCache):
+ (WebFrameLoaderClient::download):
+ (WebFrameLoaderClient::dispatchIdentifierForInitialRequest):
+ (WebFrameLoaderClient::dispatchWillSendRequest):
+ (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
+ (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
+ (WebFrameLoaderClient::dispatchDidReceiveResponse):
+ (WebFrameLoaderClient::dispatchDidReceiveContentLength):
+ (WebFrameLoaderClient::dispatchDidFinishLoading):
+ (WebFrameLoaderClient::dispatchDidFailLoading):
+ (WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
+ (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
+ (WebFrameLoaderClient::dispatchDidCancelClientRedirect):
+ (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
+ (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
+ (WebFrameLoaderClient::dispatchWillClose):
+ (WebFrameLoaderClient::dispatchDidReceiveIcon):
+ (WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
+ (WebFrameLoaderClient::dispatchDidReceiveTitle):
+ (WebFrameLoaderClient::dispatchDidCommitLoad):
+ (WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
+ (WebFrameLoaderClient::dispatchDidFailLoad):
+ (WebFrameLoaderClient::dispatchDidFinishLoad):
+ (WebFrameLoaderClient::dispatchDidFirstLayout):
+ (WebFrameLoaderClient::dispatchCreatePage):
+ (WebFrameLoaderClient::dispatchShow):
+ (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
+ (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+ (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+ (WebFrameLoaderClient::dispatchUnableToImplementPolicy):
+ (WebFrameLoaderClient::dispatchWillSubmitForm):
+ (WebFrameLoaderClient::dispatchDidLoadMainResource):
+ (WebFrameLoaderClient::clearLoadingFromPageCache):
+ (WebFrameLoaderClient::isLoadingFromPageCache):
+ (WebFrameLoaderClient::revertToProvisionalState):
+ (WebFrameLoaderClient::setMainDocumentError):
+ (WebFrameLoaderClient::clearUnarchivingState):
+ (WebFrameLoaderClient::progressStarted):
+ (WebFrameLoaderClient::progressCompleted):
+ (WebFrameLoaderClient::incrementProgress):
+ (WebFrameLoaderClient::completeProgress):
+ (WebFrameLoaderClient::setMainFrameDocumentReady):
+ (WebFrameLoaderClient::startDownload):
+ (WebFrameLoaderClient::willChangeTitle):
+ (WebFrameLoaderClient::didChangeTitle):
+ (WebFrameLoaderClient::committedLoad):
+ (WebFrameLoaderClient::finishedLoading):
+ (WebFrameLoaderClient::finalSetupForReplace):
+ (WebFrameLoaderClient::cancelledError):
+ (WebFrameLoaderClient::cannotShowURLError):
+ (WebFrameLoaderClient::interruptForPolicyChangeError):
+ (WebFrameLoaderClient::cannotShowMIMETypeError):
+ (WebFrameLoaderClient::fileDoesNotExistError):
+ (WebFrameLoaderClient::shouldFallBack):
+ (WebFrameLoaderClient::mainFrameURL):
+ (WebFrameLoaderClient::setDefersCallbacks):
+ (WebFrameLoaderClient::willUseArchive):
+ (WebFrameLoaderClient::isArchiveLoadPending):
+ (WebFrameLoaderClient::cancelPendingArchiveLoad):
+ (WebFrameLoaderClient::clearArchivedResources):
+ (WebFrameLoaderClient::canHandleRequest):
+ (WebFrameLoaderClient::canShowMIMEType):
+ (WebFrameLoaderClient::representationExistsForURLScheme):
+ (WebFrameLoaderClient::generatedMIMETypeForURLScheme):
+ (WebFrameLoaderClient::elementForEvent):
+ (WebFrameLoaderClient::createPolicyDecider):
+ (WebFrameLoaderClient::frameLoadCompleted):
+ (WebFrameLoaderClient::restoreScrollPositionAndViewState):
+ (WebFrameLoaderClient::provisionalLoadStarted):
+ (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
+ (WebFrameLoaderClient::addHistoryItemForFragmentScroll):
+ (WebFrameLoaderClient::didFinishLoad):
+ (WebFrameLoaderClient::prepareForDataSourceReplacement):
+ (WebFrameLoaderClient::createDocumentLoader):
+ (WebFrameLoaderClient::setTitle):
+ * WebKit.xcodeproj/project.pbxproj:
+ * WebView/WebDataSource.mm:
+ (-[WebDataSource webFrame]):
+ * WebView/WebFrame.mm:
+ (frame):
+ (-[WebFrame _loadItem:withLoadType:]):
+ (-[WebFrame _reloadForPluginChanges]):
+ (-[WebFrame _initWithWebFrameView:webView:bridge:]):
+ (-[WebFrame _frameLoader]):
+ (-[WebFrame provisionalDataSource]):
+ (-[WebFrame dataSource]):
+ (-[WebFrame parentFrame]):
+ (-[WebFrame _provisionalLoadStarted]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLRepresentation.m:
+ (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+ * WebView/WebHTMLView.m:
+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+ (-[NSArray validateUserInterfaceItem:]):
+ (-[NSArray scrollWheel:]):
+ (-[NSArray acceptsFirstMouse:]):
+ (-[NSArray shouldDelayWindowOrderingForEvent:]):
+ (-[NSArray _selectionStartFontAttributesAsRTF]):
+ (-[NSArray changeBaseWritingDirection:]):
+ (-[NSArray indent:]):
+ (-[NSArray outdent:]):
+ (-[WebHTMLView copy:]):
+ (-[WebHTMLView cut:]):
+ (-[WebHTMLView paste:]):
+ * WebView/WebView.mm:
+ (-[WebView _dashboardRegions]):
+ (-[WebView setProhibitsMainFrameScrolling:]):
+ (-[WebView _setInViewSourceMode:]):
+ (-[WebView _inViewSourceMode]):
+ (-[WebView setEditable:]):
+
2006-10-24 John Sullivan <sullivan@apple.com>
Reviewed by Kevin Decker
if (hideReferrer)
[(NSMutableURLRequest *)request _web_setHTTPReferrer:nil];
- _loader = NetscapePlugInStreamLoader::create([bridge impl], self).release();
+ _loader = NetscapePlugInStreamLoader::create([bridge _frame], self).release();
isTerminated = NO;
// we can't make the internal DOM headers private since they are not generated at the time installhdrs is called
@interface DOMHTMLElement (WebCoreInternal)
-+ (DOMHTMLElement *)_HTMLElementWith:(WebCore::HTMLElement *)impl;
++ (DOMHTMLElement *)_HTMLElementWith:(WebCore::HTMLElement*)impl;
@end
@interface DOMRange (WebCoreInternal)
-+ (DOMRange *)_rangeWith:(WebCore::Range *)impl;
++ (DOMRange *)_rangeWith:(WebCore::Range*)impl;
@end
WebEditorClient::WebEditorClient()
--- /dev/null
+/*
+ * 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/RetainPtr.h>
+#import <WebCore/WebFrameLoaderClient.h>
+
+@class WebFrame;
+
+class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
+public:
+ WebFrameLoaderClient(WebFrame*);
+ WebFrame* webFrame() const { return m_webFrame.get(); }
+
+ virtual void detachFrameLoader();
+
+ virtual bool hasWebView() const; // mainly for assertions
+ virtual bool hasFrameView() const; // ditto
+
+ virtual bool hasBackForwardList() const;
+ virtual void resetBackForwardList();
+
+ virtual bool provisionalItemIsTarget() const;
+ virtual bool loadProvisionalItemFromPageCache();
+ virtual void invalidateCurrentItemPageCache();
+
+ virtual bool privateBrowsingEnabled() const;
+
+ virtual void makeDocumentView();
+ virtual void makeRepresentation(WebCore::DocumentLoader*);
+ virtual void setDocumentViewFromPageCache(NSDictionary *);
+ virtual void forceLayout();
+ virtual void forceLayoutForNonHTML();
+
+ virtual void updateHistoryForCommit();
+
+ virtual void updateHistoryForBackForwardNavigation();
+ virtual void updateHistoryForReload();
+ virtual void updateHistoryForStandardLoad();
+ virtual void updateHistoryForInternalLoad();
+
+ virtual void updateHistoryAfterClientRedirect();
+
+ virtual void setCopiesOnScroll();
+
+ virtual WebCore::LoadErrorResetToken* tokenForLoadErrorReset();
+ virtual void resetAfterLoadError(WebCore::LoadErrorResetToken*);
+ virtual void doNotResetAfterLoadError(WebCore::LoadErrorResetToken*);
+
+ virtual void detachedFromParent1();
+ virtual void detachedFromParent2();
+ virtual void detachedFromParent3();
+ virtual void detachedFromParent4();
+
+ virtual void loadedFromPageCache();
+
+ virtual void download(NSURLConnection *, NSURLRequest *, NSURLResponse *, id proxy);
+
+ virtual id dispatchIdentifierForInitialRequest(WebCore::DocumentLoader*, NSURLRequest *);
+ virtual NSURLRequest *dispatchWillSendRequest(WebCore::DocumentLoader*, id identifier, NSURLRequest *, NSURLResponse *redirectResponse);
+ virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, id identifier, NSURLAuthenticationChallenge *);
+ virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, id identifier, NSURLAuthenticationChallenge *);
+ virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, id identifier, NSURLResponse *);
+ virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, id identifier, int lengthReceived);
+ virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, id identifier);
+ virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, id identifier, NSError *);
+
+ virtual void dispatchDidHandleOnloadEvents();
+ virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+ virtual void dispatchDidCancelClientRedirect();
+ virtual void dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval, NSDate *);
+ virtual void dispatchDidChangeLocationWithinPage();
+ virtual void dispatchWillClose();
+ virtual void dispatchDidReceiveIcon(NSImage *);
+ virtual void dispatchDidStartProvisionalLoad();
+ virtual void dispatchDidReceiveTitle(NSString *title);
+ virtual void dispatchDidCommitLoad();
+ virtual void dispatchDidFailProvisionalLoad(NSError *);
+ virtual void dispatchDidFailLoad(NSError *);
+ virtual void dispatchDidFinishLoad();
+ virtual void dispatchDidFirstLayout();
+
+ virtual WebCore::Frame* dispatchCreatePage(NSURLRequest *);
+ virtual void dispatchShow();
+
+ virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *);
+ virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName);
+ virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *);
+ virtual void dispatchUnableToImplementPolicy(NSError *);
+
+ virtual void dispatchWillSubmitForm(WebPolicyDecider *, WebCore::Frame* sourceFrame, WebCore::Element* form, NSDictionary *values);
+
+ virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*);
+ virtual void clearLoadingFromPageCache(WebCore::DocumentLoader*);
+ virtual bool isLoadingFromPageCache(WebCore::DocumentLoader*);
+ virtual void revertToProvisionalState(WebCore::DocumentLoader*);
+ virtual void setMainDocumentError(WebCore::DocumentLoader*, NSError *);
+ virtual void clearUnarchivingState(WebCore::DocumentLoader*);
+
+ virtual void progressStarted();
+ virtual void progressCompleted();
+
+ virtual void incrementProgress(id identifier, NSURLResponse *);
+ virtual void incrementProgress(id identifier, NSData *);
+ virtual void completeProgress(id identifier);
+
+ virtual void setMainFrameDocumentReady(bool);
+
+ virtual void startDownload(NSURLRequest *);
+
+ virtual void willChangeTitle(WebCore::DocumentLoader*);
+ virtual void didChangeTitle(WebCore::DocumentLoader*);
+
+ virtual void committedLoad(WebCore::DocumentLoader*, NSData *);
+ virtual void finishedLoading(WebCore::DocumentLoader*);
+ virtual void finalSetupForReplace(WebCore::DocumentLoader*);
+
+ virtual NSError *cancelledError(NSURLRequest *);
+ virtual NSError *cannotShowURLError(NSURLRequest *);
+ virtual NSError *interruptForPolicyChangeError(NSURLRequest *);
+
+ virtual NSError *cannotShowMIMETypeError(NSURLResponse *);
+ virtual NSError *fileDoesNotExistError(NSURLResponse *);
+
+ virtual bool shouldFallBack(NSError *);
+
+ virtual NSURL *mainFrameURL();
+
+ virtual void setDefersCallbacks(bool);
+
+ virtual bool willUseArchive(WebCore::WebResourceLoader*, NSURLRequest *, NSURL *originalURL) const;
+ virtual bool isArchiveLoadPending(WebCore::WebResourceLoader*) const;
+ virtual void cancelPendingArchiveLoad(WebCore::WebResourceLoader*);
+ virtual void clearArchivedResources();
+
+ virtual bool canHandleRequest(NSURLRequest *) const;
+ virtual bool canShowMIMEType(NSString *MIMEType) const;
+ virtual bool representationExistsForURLScheme(NSString *URLScheme) const;
+ virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const;
+
+ virtual NSDictionary *elementForEvent(NSEvent *) const;
+
+ virtual WebPolicyDecider *createPolicyDecider(id object, SEL selector);
+
+ virtual void frameLoadCompleted();
+ virtual void restoreScrollPositionAndViewState();
+ virtual void provisionalLoadStarted();
+ virtual bool shouldTreatURLAsSameAsCurrent(NSURL *) const;
+ virtual void addHistoryItemForFragmentScroll();
+ virtual void didFinishLoad();
+ virtual void prepareForDataSourceReplacement();
+ virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(NSURLRequest *);
+ virtual void setTitle(NSString *title, NSURL *);
+
+private:
+ WebCore::RetainPtr<WebFrame> m_webFrame;
+};
--- /dev/null
+/*
+ * 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 "WebFrameLoaderClient.h"
+
+#import "WebFrameInternal.h"
+#import <WebCore/FrameMac.h>
+#import <WebCore/WebCoreFrameBridge.h>
+#import <WebCore/WebDocumentLoader.h>
+#import <WebKit/DOMElement.h>
+#import <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+// FIXME: We should have a way to get the following DOM interface from the WebCore internal headers, but we
+// can't make the internal DOM headers private since they are not generated at the time installhdrs is called.
+
+@interface DOMElement (WebCoreInternal)
++ (DOMElement *)_elementWith:(WebCore::Element*)impl;
+@end
+
+WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame)
+ : m_webFrame(webFrame)
+{
+}
+
+void WebFrameLoaderClient::detachFrameLoader()
+{
+ delete this;
+}
+
+bool WebFrameLoaderClient::hasWebView() const
+{
+ return [m_webFrame.get() _hasWebView];
+}
+
+bool WebFrameLoaderClient::hasFrameView() const
+{
+ return [m_webFrame.get() _hasFrameView];
+}
+
+bool WebFrameLoaderClient::hasBackForwardList() const
+{
+ return [m_webFrame.get() _hasBackForwardList];
+}
+
+void WebFrameLoaderClient::resetBackForwardList()
+{
+ [m_webFrame.get() _resetBackForwardList];
+}
+
+bool WebFrameLoaderClient::provisionalItemIsTarget() const
+{
+ return [m_webFrame.get() _provisionalItemIsTarget];
+}
+
+bool WebFrameLoaderClient::loadProvisionalItemFromPageCache()
+{
+ return [m_webFrame.get() _loadProvisionalItemFromPageCache];
+}
+
+void WebFrameLoaderClient::invalidateCurrentItemPageCache()
+{
+ [m_webFrame.get() _invalidateCurrentItemPageCache];
+}
+
+bool WebFrameLoaderClient::privateBrowsingEnabled() const
+{
+ return [m_webFrame.get() _privateBrowsingEnabled];
+}
+
+void WebFrameLoaderClient::makeDocumentView()
+{
+ [m_webFrame.get() _makeDocumentView];
+}
+
+void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader)
+{
+ [m_webFrame.get() _makeRepresentationForDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::setDocumentViewFromPageCache(NSDictionary *dictionary)
+{
+ [m_webFrame.get() _setDocumentViewFromPageCache:dictionary];
+}
+
+void WebFrameLoaderClient::forceLayout()
+{
+ [m_webFrame.get() _forceLayout];
+}
+
+void WebFrameLoaderClient::forceLayoutForNonHTML()
+{
+ [m_webFrame.get() _forceLayoutForNonHTML];
+}
+
+void WebFrameLoaderClient::updateHistoryForCommit()
+{
+ [m_webFrame.get() _updateHistoryForCommit];
+}
+
+void WebFrameLoaderClient::updateHistoryForBackForwardNavigation()
+{
+ [m_webFrame.get() _updateHistoryForBackForwardNavigation];
+}
+
+void WebFrameLoaderClient::updateHistoryForReload()
+{
+ [m_webFrame.get() _updateHistoryForReload];
+}
+
+void WebFrameLoaderClient::updateHistoryForStandardLoad()
+{
+ [m_webFrame.get() _updateHistoryForStandardLoad];
+}
+
+void WebFrameLoaderClient::updateHistoryForInternalLoad()
+{
+ [m_webFrame.get() _updateHistoryForInternalLoad];
+}
+
+
+void WebFrameLoaderClient::updateHistoryAfterClientRedirect()
+{
+ [m_webFrame.get() _updateHistoryAfterClientRedirect];
+}
+
+void WebFrameLoaderClient::setCopiesOnScroll()
+{
+ [m_webFrame.get() _setCopiesOnScroll];
+}
+
+LoadErrorResetToken* WebFrameLoaderClient::tokenForLoadErrorReset()
+{
+ return [m_webFrame.get() _tokenForLoadErrorReset];
+}
+
+void WebFrameLoaderClient::resetAfterLoadError(LoadErrorResetToken* token)
+{
+ [m_webFrame.get() _resetAfterLoadError:token];
+}
+
+void WebFrameLoaderClient::doNotResetAfterLoadError(LoadErrorResetToken* token)
+{
+ [m_webFrame.get() _doNotResetAfterLoadError:token];
+}
+
+void WebFrameLoaderClient::detachedFromParent1()
+{
+ [m_webFrame.get() _detachedFromParent1];
+}
+
+void WebFrameLoaderClient::detachedFromParent2()
+{
+ [m_webFrame.get() _detachedFromParent2];
+}
+
+void WebFrameLoaderClient::detachedFromParent3()
+{
+ [m_webFrame.get() _detachedFromParent3];
+}
+
+void WebFrameLoaderClient::detachedFromParent4()
+{
+ [m_webFrame.get() _detachedFromParent4];
+}
+
+void WebFrameLoaderClient::loadedFromPageCache()
+{
+ [m_webFrame.get() _loadedFromPageCache];
+}
+
+void WebFrameLoaderClient::download(NSURLConnection *connection, NSURLRequest *request,
+ NSURLResponse *response, id proxy)
+{
+ [m_webFrame.get() _downloadWithLoadingConnection:connection request:request response:response proxy:proxy];
+}
+
+id WebFrameLoaderClient::dispatchIdentifierForInitialRequest(DocumentLoader* loader, NSURLRequest *request)
+{
+ return [m_webFrame.get() _dispatchIdentifierForInitialRequest:request fromDocumentLoader:loader];
+}
+
+NSURLRequest *WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, id identifier,
+ NSURLRequest *request, NSURLResponse *redirectResponse)
+{
+ return [m_webFrame.get() _dispatchResource:identifier willSendRequest:request
+ redirectResponse:redirectResponse fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, id identifier,
+ NSURLAuthenticationChallenge *challenge)
+{
+ [m_webFrame.get() _dispatchDidReceiveAuthenticationChallenge:challenge forResource:identifier
+ fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader* loader, id identifier,
+ NSURLAuthenticationChallenge *challenge)
+{
+ [m_webFrame.get() _dispatchDidCancelAuthenticationChallenge:challenge forResource:identifier
+ fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader* loader, id identifier, NSURLResponse *response)
+{
+ [m_webFrame.get() _dispatchResource:identifier didReceiveResponse:response fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loader, id identifier, int lengthReceived)
+{
+ [m_webFrame.get() _dispatchResource:identifier didReceiveContentLength:lengthReceived fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader* loader, id identifier)
+{
+ [m_webFrame.get() _dispatchResource:identifier didFinishLoadingFromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, id identifier, NSError *error)
+{
+ [m_webFrame.get() _dispatchResource:identifier didFailLoadingWithError:error fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidHandleOnloadEvents()
+{
+ [m_webFrame.get() _dispatchDidHandleOnloadEventsForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+ [m_webFrame.get() _dispatchDidReceiveServerRedirectForProvisionalLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
+{
+ [m_webFrame.get() _dispatchDidCancelClientRedirectForFrame];
+}
+
+void WebFrameLoaderClient::dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval delay, NSDate *fireDate)
+{
+ [m_webFrame.get() _dispatchWillPerformClientRedirectToURL:URL delay:delay fireDate:fireDate];
+}
+
+void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage()
+{
+ [m_webFrame.get() _dispatchDidChangeLocationWithinPageForFrame];
+}
+
+void WebFrameLoaderClient::dispatchWillClose()
+{
+ [m_webFrame.get() _dispatchWillCloseFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveIcon(NSImage *icon)
+{
+ [m_webFrame.get() _dispatchDidReceiveIcon:icon];
+}
+
+void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
+{
+ [m_webFrame.get() _dispatchDidStartProvisionalLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveTitle(NSString *title)
+{
+ [m_webFrame.get() _dispatchDidReceiveTitle:title];
+}
+
+void WebFrameLoaderClient::dispatchDidCommitLoad()
+{
+ [m_webFrame.get() _dispatchDidCommitLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(NSError *error)
+{
+ [m_webFrame.get() _dispatchDidFailProvisionalLoadWithError:error];
+}
+
+void WebFrameLoaderClient::dispatchDidFailLoad(NSError *error)
+{
+ [m_webFrame.get() _dispatchDidFailLoadWithError:error];
+}
+
+void WebFrameLoaderClient::dispatchDidFinishLoad()
+{
+ [m_webFrame.get() _dispatchDidFinishLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidFirstLayout()
+{
+ [m_webFrame.get() _dispatchDidFirstLayoutInFrame];
+}
+
+Frame* WebFrameLoaderClient::dispatchCreatePage(NSURLRequest *request)
+{
+ return [[m_webFrame.get() _dispatchCreateWebViewWithRequest:request] _frame];
+}
+
+void WebFrameLoaderClient::dispatchShow()
+{
+ [m_webFrame.get() _dispatchShow];
+}
+
+void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, NSString *MIMEType,
+ NSURLRequest *request)
+{
+ [m_webFrame.get() _dispatchDecidePolicyForMIMEType:MIMEType request:request decider:decider];
+}
+
+void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action,
+ NSURLRequest *request, NSString *frameName)
+{
+ [m_webFrame.get() _dispatchDecidePolicyForNewWindowAction:action request:request newFrameName:frameName
+ decider:decider];
+}
+
+void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebPolicyDecider *decider, NSDictionary *action,
+ NSURLRequest *request)
+{
+ [m_webFrame.get() _dispatchDecidePolicyForNavigationAction:action request:request decider:decider];
+}
+
+void WebFrameLoaderClient::dispatchUnableToImplementPolicy(NSError *error)
+{
+ [m_webFrame.get() _dispatchUnableToImplementPolicyWithError:error];
+}
+
+void WebFrameLoaderClient::dispatchWillSubmitForm(WebPolicyDecider *decider, Frame* sourceFrame,
+ Element* form, NSDictionary *values)
+{
+ [m_webFrame.get() _dispatchSourceFrame:Mac(sourceFrame)->bridge()
+ willSubmitForm:[DOMElement _elementWith:form] withValues:values submissionDecider:decider];
+}
+
+void WebFrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader* loader)
+{
+ [m_webFrame.get() _dispatchDidLoadMainResourceForDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::clearLoadingFromPageCache(DocumentLoader* loader)
+{
+ [m_webFrame.get() _clearLoadingFromPageCacheForDocumentLoader:loader];
+}
+
+bool WebFrameLoaderClient::isLoadingFromPageCache(DocumentLoader* loader)
+{
+ return [m_webFrame.get() _isDocumentLoaderLoadingFromPageCache:loader];
+}
+
+void WebFrameLoaderClient::revertToProvisionalState(DocumentLoader* loader)
+{
+ [m_webFrame.get() _revertToProvisionalStateForDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::setMainDocumentError(DocumentLoader* loader, NSError *error)
+{
+ [m_webFrame.get() _setMainDocumentError:error forDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::clearUnarchivingState(DocumentLoader* loader)
+{
+ [m_webFrame.get() _clearUnarchivingStateForLoader:loader];
+}
+
+void WebFrameLoaderClient::progressStarted()
+{
+ [m_webFrame.get() _progressStarted];
+}
+
+void WebFrameLoaderClient::progressCompleted()
+{
+ [m_webFrame.get() _progressCompleted];
+}
+
+void WebFrameLoaderClient::incrementProgress(id identifier, NSURLResponse *response)
+{
+ [m_webFrame.get() _incrementProgressForIdentifier:identifier response:response];
+}
+
+void WebFrameLoaderClient::incrementProgress(id identifier, NSData *data)
+{
+ [m_webFrame.get() _incrementProgressForIdentifier:identifier data:data];
+}
+
+void WebFrameLoaderClient::completeProgress(id identifier)
+{
+ [m_webFrame.get() _completeProgressForIdentifier:identifier];
+}
+
+void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready)
+{
+ [m_webFrame.get() _setMainFrameDocumentReady:ready];
+}
+
+void WebFrameLoaderClient::startDownload(NSURLRequest *request)
+{
+ [m_webFrame.get() _startDownloadWithRequest:request];
+}
+
+void WebFrameLoaderClient::willChangeTitle(DocumentLoader* loader)
+{
+ [m_webFrame.get() _willChangeTitleForDocument:loader];
+}
+
+void WebFrameLoaderClient::didChangeTitle(DocumentLoader* loader)
+{
+ [m_webFrame.get() _didChangeTitleForDocument:loader];
+}
+
+void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, NSData *data)
+{
+ [m_webFrame.get() _committedLoadWithDocumentLoader:loader data:data];
+}
+
+void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
+{
+ [m_webFrame.get() _finishedLoadingDocument:loader];
+}
+
+void WebFrameLoaderClient::finalSetupForReplace(DocumentLoader* loader)
+{
+ [m_webFrame.get() _finalSetupForReplaceWithDocumentLoader:loader];
+}
+
+NSError *WebFrameLoaderClient::cancelledError(NSURLRequest *request)
+{
+ return [m_webFrame.get() _cancelledErrorWithRequest:request];
+}
+
+NSError *WebFrameLoaderClient::cannotShowURLError(NSURLRequest *request)
+{
+ return [m_webFrame.get() _cannotShowURLErrorWithRequest:request];
+}
+
+NSError *WebFrameLoaderClient::interruptForPolicyChangeError(NSURLRequest *request)
+{
+ return [m_webFrame.get() _interruptForPolicyChangeErrorWithRequest:request];
+}
+
+NSError *WebFrameLoaderClient::cannotShowMIMETypeError(NSURLResponse *response)
+{
+ return [m_webFrame.get() _cannotShowMIMETypeErrorWithResponse:response];
+}
+
+NSError *WebFrameLoaderClient::fileDoesNotExistError(NSURLResponse *response)
+{
+ return [m_webFrame.get() _fileDoesNotExistErrorWithResponse:response];
+}
+
+bool WebFrameLoaderClient::shouldFallBack(NSError *error)
+{
+ return [m_webFrame.get() _shouldFallBackForError:error];
+}
+
+NSURL *WebFrameLoaderClient::mainFrameURL()
+{
+ return [m_webFrame.get() _mainFrameURL];
+}
+
+void WebFrameLoaderClient::setDefersCallbacks(bool defers)
+{
+ [m_webFrame.get() _setDefersCallbacks:defers];
+}
+
+bool WebFrameLoaderClient::willUseArchive(WebResourceLoader* loader, NSURLRequest *request, NSURL *originalURL) const
+{
+ return [m_webFrame.get() _willUseArchiveForRequest:request originalURL:originalURL loader:loader];
+}
+
+bool WebFrameLoaderClient::isArchiveLoadPending(WebResourceLoader* loader) const
+{
+ return [m_webFrame.get() _archiveLoadPendingForLoader:loader];
+}
+
+void WebFrameLoaderClient::cancelPendingArchiveLoad(WebResourceLoader* loader)
+{
+ [m_webFrame.get() _cancelPendingArchiveLoadForLoader:loader];
+}
+
+void WebFrameLoaderClient::clearArchivedResources()
+{
+ [m_webFrame.get() _clearArchivedResources];
+}
+
+bool WebFrameLoaderClient::canHandleRequest(NSURLRequest *request) const
+{
+ return [m_webFrame.get() _canHandleRequest:request];
+}
+
+bool WebFrameLoaderClient::canShowMIMEType(NSString *MIMEType) const
+{
+ return [m_webFrame.get() _canShowMIMEType:MIMEType];
+}
+
+bool WebFrameLoaderClient::representationExistsForURLScheme(NSString *URLScheme) const
+{
+ return [m_webFrame.get() _representationExistsForURLScheme:URLScheme];
+}
+
+NSString *WebFrameLoaderClient::generatedMIMETypeForURLScheme(NSString *URLScheme) const
+{
+ return [m_webFrame.get() _generatedMIMETypeForURLScheme:URLScheme];
+}
+
+NSDictionary *WebFrameLoaderClient::elementForEvent(NSEvent *event) const
+{
+ return [m_webFrame.get() _elementForEvent:event];
+}
+
+WebPolicyDecider *WebFrameLoaderClient::createPolicyDecider(id object, SEL selector)
+{
+ return [m_webFrame.get() _createPolicyDeciderWithTarget:object action:selector];
+}
+
+void WebFrameLoaderClient::frameLoadCompleted()
+{
+ [m_webFrame.get() _frameLoadCompleted];
+}
+
+void WebFrameLoaderClient::restoreScrollPositionAndViewState()
+{
+ [m_webFrame.get() _restoreScrollPositionAndViewState];
+}
+
+void WebFrameLoaderClient::provisionalLoadStarted()
+{
+ [m_webFrame.get() _provisionalLoadStarted];
+}
+
+bool WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent(NSURL *URL) const
+{
+ return [m_webFrame.get() _shouldTreatURLAsSameAsCurrent:URL];
+}
+
+void WebFrameLoaderClient::addHistoryItemForFragmentScroll()
+{
+ [m_webFrame.get() _addHistoryItemForFragmentScroll];
+}
+
+void WebFrameLoaderClient::didFinishLoad()
+{
+ [m_webFrame.get() _didFinishLoad];
+}
+
+void WebFrameLoaderClient::prepareForDataSourceReplacement()
+{
+ [m_webFrame.get() _prepareForDataSourceReplacement];
+}
+
+PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(NSURLRequest *request)
+{
+ return [m_webFrame.get() _createDocumentLoaderWithRequest:request];
+}
+
+void WebFrameLoaderClient::setTitle(NSString *title, NSURL *URL)
+{
+ [m_webFrame.get() _setTitle:title forURL:URL];
+}
7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.m */; };
7E6FEF0A08985A7200C44C3F /* WebScriptDebugDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0708985A7200C44C3F /* WebScriptDebugDelegatePrivate.h */; };
+ 931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */; };
+ 931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */; };
939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; };
939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; };
939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebHTMLRepresentation.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 35081D9502B6D4D80ACA2ACA /* WebHTMLView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebHTMLView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 35081D9502B6D4D80ACA2ACA /* WebHTMLView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebHTMLView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
35081D9602B6D4D80ACA2ACA /* WebHTMLViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
35081DAE02B6D4F50ACA2ACA /* WebDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
35F3577F0198AAB80ACA1520 /* English */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPanelAuthenticationHandler.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPanelAuthenticationHandler.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoaderClient.h; sourceTree = "<group>"; };
+ 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameLoaderClient.mm; sourceTree = "<group>"; };
93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
931A72D203265920008635CE /* WebBaseNetscapePluginViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
932399D8034CF7F6008635CE /* English */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; name = English; path = English.lproj/StringsNotToBeLocalized.txt; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5B36B400281DE87018635CB /* WebCoreSupport */ = {
isa = PBXGroup;
children = (
+ 9305892A070868B300E79D96 /* WebDashboardRegion.h */,
4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */,
4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */,
- 51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */,
- 51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */,
- 65C7F42A0979DE640022E453 /* WebPageBridge.h */,
- 65C7F42B0979DE640022E453 /* WebPageBridge.mm */,
F5AFB45E02B94DC8018635CA /* WebFrameBridge.h */,
F5AFB45F02B94DC8018635CA /* WebFrameBridge.mm */,
- 9305892A070868B300E79D96 /* WebDashboardRegion.h */,
- 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
+ 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */,
+ 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */,
+ 51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */,
+ 51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */,
9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */,
9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */,
+ 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
84723BE3056D719E0044BFEA /* WebKeyGenerator.h */,
84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
+ 65C7F42A0979DE640022E453 /* WebPageBridge.h */,
+ 65C7F42B0979DE640022E453 /* WebPageBridge.mm */,
93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
93EB178C09F88D460091F8FF /* WebSystemInterface.m */,
F5F7174C02885C5B018635CA /* WebViewFactory.h */,
1C8CB07A0AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h in Headers */,
4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */,
1CA57D620AED6A470009BDD0 /* WebGraphicsExtras.h in Headers */,
+ 931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
- shouldCheckCompatibility = 1;
targets = (
9398100A0824BF01008DF038 /* WebKit */,
);
658BA6FD0ADB39DE00AEB387 /* WebPolicyDeciderMac.m in Sources */,
4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */,
1CA57D630AED6A470009BDD0 /* WebGraphicsExtras.c in Sources */,
+ 931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#import "WebArchive.h"
#import "WebArchiver.h"
-#import <WebCore/WebDataProtocol.h>
-#import <WebKit/WebDataSourceInternal.h>
+#import "WebDataSourceInternal.h"
#import "WebDefaultResourceLoadDelegate.h"
#import "WebDocument.h"
+#import "WebDocumentLoaderMac.h"
#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
-#import <WebCore/WebFrameLoader.h>
#import "WebFrameLoadDelegate.h"
+#import "WebFrameLoaderClient.h"
#import "WebHTMLRepresentation.h"
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
#import "WebUnarchivingState.h"
#import "WebViewInternal.h"
#import <JavaScriptCore/Assertions.h>
+#import <WebCore/WebDataProtocol.h>
+#import <WebCore/WebFrameLoader.h>
#import <WebKit/DOMHTML.h>
#import <WebKit/DOMPrivate.h>
#import <WebKitSystemInterface.h>
-#import "WebDocumentLoaderMac.h"
using namespace WebCore;
FrameLoader* frameLoader = _private->loader->frameLoader();
if (!frameLoader)
return nil;
- return (WebFrame *)frameLoader->client();
+ return static_cast<WebFrameLoaderClient*>(frameLoader->client())->webFrame();
}
- (NSURLRequest *)initialRequest
#import "WebDownloadInternal.h"
#import "WebFrameBridge.h"
#import "WebFrameLoadDelegate.h"
+#import "WebFrameLoaderClient.h"
#import "WebFrameViewInternal.h"
#import "WebHTMLRepresentationPrivate.h"
#import "WebHTMLViewInternal.h"
#import "WebUIDelegate.h"
#import "WebViewInternal.h"
#import <WebCore/Element.h>
-#import <WebCore/Frame.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/FrameTree.h>
#import <WebCore/WebDataProtocol.h>
#import <WebCore/WebFormDataStream.h>
#import <WebCore/WebFormState.h>
#import <WebCore/WebFrameLoader.h>
-#import <WebCore/WebFrameLoaderClient.h>
#import <WebCore/WebLoader.h>
#import <WebKit/DOM.h>
#import <WebKitSystemInterface.h>
- (WebHistoryItem *)_currentBackForwardListItemToResetTo;
@end
-@interface WebFrame (WebFrameLoaderClient) <WebFrameLoaderClient>
-@end
-
@interface NSView (WebFramePluginHosting)
- (void)setWebFrame:(WebFrame *)webFrame;
@end
return [(WebFrameBridge *)bridge webFrame];
}
+static inline WebFrame *frame(Frame* f)
+{
+ return f ? [(WebFrameBridge *)Mac(f)->bridge() webFrame] : nil;
+}
+
@implementation WebFrame (FrameTraversal)
- (WebFrame *)_firstChildFrame
[self _saveScrollPositionAndViewStateToItem:_private->currentItem];
// FIXME: form state might want to be saved here too
- // We always call scrollToAnchorWithURL here, even if the URL doesn't have an
+ // We always call scrollToAnchor here, even if the URL doesn't have an
// anchor fragment. This is so we'll keep the WebCore Frame's URL up-to-date.
- [_private->bridge scrollToAnchorWithURL:[item URL]];
+ [_private->bridge _frame]->scrollToAnchor([item URL]);
// must do this maintenance here, since we don't go through a real page reload
[_private setCurrentItem:item];
{
for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
- if (([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge containsPlugins]))
+ if (([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge _frame]->containsPlugins()))
[frame reload];
}
}
++WebFrameCount;
- [bridge setFrameLoaderClient:self];
+ [self _frameLoader]->setClient(new WebFrameLoaderClient(self));
return self;
}
- (FrameLoader*)_frameLoader
{
- return [_private->bridge frameLoader];
+ Frame* frame = [_private->bridge _frame];
+ return frame ? frame->loader() : 0;
}
static inline WebDataSource *dataSource(DocumentLoader* loader)
- (WebDataSource *)provisionalDataSource
{
- WebCoreFrameLoader* frameLoader = [self _frameLoader];
+ FrameLoader* frameLoader = [self _frameLoader];
return frameLoader ? dataSource(frameLoader->provisionalDocumentLoader()) : nil;
}
- (WebDataSource *)dataSource
{
- WebCoreFrameLoader* frameLoader = [self _frameLoader];
+ FrameLoader* frameLoader = [self _frameLoader];
return frameLoader ? dataSource(frameLoader->documentLoader()) : nil;
}
- (WebFrame *)parentFrame
{
- return [[frame([[self _bridge] parent]) retain] autorelease];
+ return [[frame([_private->bridge _frame]->tree()->parent()) retain] autorelease];
}
- (NSArray *)childFrames
}
} else
// Put the document into a null state, so it can be restored correctly.
- [_private->bridge clear];
+ [_private->bridge _frame]->clear();
} else
LOG(PageCache, "NOT saving page to back/forward cache, %@\n", [[self dataSource] _URL]);
}
#import "WebPolicyDelegatePrivate.h"
#import <WebCore/FrameLoaderTypes.h>
+#ifdef __cplusplus
+#import <wtf/Forward.h>
+#endif
+
+@class WebCoreFrameBridge;
@class WebDocumentLoader;
@class WebInspector;
@class WebFrameView;
@class WebFrameBridge;
+@class WebPolicyDecider;
#ifdef __cplusplus
+
namespace WebCore {
class DocumentLoader;
class FrameLoader;
+ class WebResourceLoader;
+ struct LoadErrorResetToken;
}
-typedef WebCore::DocumentLoader WebCoreDocumentLoader;
-typedef WebCore::FrameLoader WebCoreFrameLoader;
-#else
-@class WebCoreDocumentLoader;
-@class WebCoreFrameLoader;
+
#endif
@interface WebFrame (WebInternal)
- (void)_addInspector:(WebInspector *)inspector;
- (void)_removeInspector:(WebInspector *)inspector;
-- (WebCoreFrameLoader*)_frameLoader;
-- (WebDataSource *)_dataSourceForDocumentLoader:(WebCoreDocumentLoader*)loader;
+#ifdef __cplusplus
+
+- (WebCore::FrameLoader*)_frameLoader;
+- (WebDataSource *)_dataSourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
+
+- (void)_addDocumentLoader:(WebCore::DocumentLoader*)loader toUnarchiveState:(WebArchive *)archive;
+
+#endif
- (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL;
- (void)_recursive_pauseNullEventsForAllNetscapePlugins;
- (void)_recursive_resumeNullEventsForAllNetscapePlugins;
-- (void)_addDocumentLoader:(WebCoreDocumentLoader*)loader toUnarchiveState:(WebArchive *)archive;
+@end
+
+#ifdef __cplusplus
+
+@interface WebFrame (WebFrameLoaderClient)
+
+- (BOOL)_hasBackForwardList;
+- (void)_resetBackForwardList;
+- (void)_invalidateCurrentItemPageCache;
+- (BOOL)_provisionalItemIsTarget;
+- (BOOL)_loadProvisionalItemFromPageCache;
+- (BOOL)_privateBrowsingEnabled;
+- (void)_makeDocumentView;
+- (void)_forceLayout;
+- (void)_updateHistoryForCommit;
+- (void)_updateHistoryForReload;
+- (void)_updateHistoryForStandardLoad;
+- (void)_updateHistoryForBackForwardNavigation;
+- (void)_updateHistoryForInternalLoad;
+- (WebCore::LoadErrorResetToken*)_tokenForLoadErrorReset;
+- (void)_resetAfterLoadError:(WebCore::LoadErrorResetToken*)token;
+- (void)_doNotResetAfterLoadError:(WebCore::LoadErrorResetToken*)token;
+- (void)_dispatchDidHandleOnloadEventsForFrame;
+- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
+- (id)_dispatchIdentifierForInitialRequest:(NSURLRequest *)clientRequest fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (NSURLRequest *)_dispatchResource:(id)identifier willSendRequest:(NSURLRequest *)clientRequest redirectResponse:(NSURLResponse *)redirectResponse fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchDidReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchDidCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didReceiveResponse:(NSURLResponse *)r fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didReceiveContentLength:(int)lengthReceived fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didFinishLoadingFromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didFailLoadingWithError:error fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchDidCancelClientRedirectForFrame;
+- (void)_dispatchWillPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
+- (void)_dispatchDidChangeLocationWithinPageForFrame;
+- (void)_dispatchWillCloseFrame;
+- (void)_dispatchDidReceiveIcon:(NSImage *)icon;
+- (void)_dispatchDidStartProvisionalLoadForFrame;
+- (void)_dispatchDidReceiveTitle:(NSString *)title;
+- (void)_dispatchDidCommitLoadForFrame;
+- (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error;
+- (void)_dispatchDidFailLoadWithError:(NSError *)error;
+- (void)_dispatchDidFinishLoadForFrame;
+- (void)_dispatchDidFirstLayoutInFrame;
+- (WebCoreFrameBridge *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
+- (void)_dispatchShow;
+- (WebPolicyDecider *)_createPolicyDeciderWithTarget:(id)target action:(SEL)action;
+- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
+- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decider:(WebPolicyDecider *)decider;
+- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
+- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error;
+- (void)_dispatchSourceFrame:(WebCoreFrameBridge *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider;
+- (void)_detachedFromParent1;
+- (void)_detachedFromParent2;
+- (void)_detachedFromParent3;
+- (void)_detachedFromParent4;
+- (void)_updateHistoryAfterClientRedirect;
+- (void)_loadedFromPageCache;
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy;
+- (void)_setDocumentViewFromPageCache:(NSDictionary *)pageCache;
+- (void)_setCopiesOnScroll;
+- (void)_dispatchDidLoadMainResourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_forceLayoutForNonHTML;
+- (void)_clearLoadingFromPageCacheForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebCore::DocumentLoader*)loader;
+- (void)_makeRepresentationForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_revertToProvisionalStateForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_setMainDocumentError:(NSError *)error forDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_clearUnarchivingStateForLoader:(WebCore::DocumentLoader*)loader;
+- (void)_progressStarted;
+- (void)_progressCompleted;
+- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response;
+- (void)_incrementProgressForIdentifier:(id)identifier data:(NSData *)data;
+- (void)_completeProgressForIdentifier:(id)identifier;
+- (void)_setMainFrameDocumentReady:(BOOL)ready;
+- (void)_willChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
+- (void)_didChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
+- (void)_startDownloadWithRequest:(NSURLRequest *)request;
+- (void)_finishedLoadingDocument:(WebCore::DocumentLoader*)loader;
+- (void)_committedLoadWithDocumentLoader:(WebCore::DocumentLoader*)loader data:(NSData *)data;
+- (void)_documentLoader:(WebCore::DocumentLoader*)loader setMainDocumentError:(NSError *)error;
+- (void)_finalSetupForReplaceWithDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (NSError *)_cancelledErrorWithRequest:(NSURLRequest *)request;
+- (NSError *)_cannotShowURLErrorWithRequest:(NSURLRequest *)request;
+- (NSError *)_interruptForPolicyChangeErrorWithRequest:(NSURLRequest *)request;
+- (NSError *)_cannotShowMIMETypeErrorWithResponse:(NSURLResponse *)response;
+- (NSError *)_fileDoesNotExistErrorWithResponse:(NSURLResponse *)response;
+- (BOOL)_shouldFallBackForError:(NSError *)error;
+- (BOOL)_hasWebView;
+- (BOOL)_hasFrameView;
+- (NSURL *)_mainFrameURL;
+- (BOOL)_canUseResourceForRequest:(NSURLRequest *)request;
+- (BOOL)_canUseResourceWithResponse:(NSURLResponse *)response;
+- (void)_deliverArchivedResourcesAfterDelay;
+- (BOOL)_willUseArchiveForRequest:(NSURLRequest *)r originalURL:(NSURL *)originalURL loader:(WebCore::WebResourceLoader*)loader;
+- (BOOL)_archiveLoadPendingForLoader:(WebCore::WebResourceLoader*)loader;
+- (void)_cancelPendingArchiveLoadForLoader:(WebCore::WebResourceLoader*)loader;
+- (void)_clearArchivedResources;
+- (void)_deliverArchivedResources;
+- (void)_setDefersCallbacks:(BOOL)defers;
+- (BOOL)_canHandleRequest:(NSURLRequest *)request;
+- (BOOL)_canShowMIMEType:(NSString *)MIMEType;
+- (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
+- (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
+- (NSDictionary *)_elementForEvent:(NSEvent *)event;
+- (void)_frameLoadCompleted;
+- (void)_restoreScrollPositionAndViewState;
+- (void)_setTitle:(NSString *)title forURL:(NSURL *)URL;
+- (PassRefPtr<WebCore::DocumentLoader>)_createDocumentLoaderWithRequest:(NSURLRequest *)request;
+- (void)_prepareForDataSourceReplacement;
+- (void)_didFinishLoad;
+- (void)_addHistoryItemForFragmentScroll;
+- (BOOL)_shouldTreatURLAsSameAsCurrent:(NSURL *)URL;
+- (void)_provisionalLoadStarted;
@end
+#endif
+
@interface NSObject (WebInternalFrameLoadDelegate)
- (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error;
@end
#import "WebView.h"
#import <Foundation/NSURLResponse.h>
#import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameMac.h>
#import <WebCore/WebDocumentLoader.h>
@interface WebHTMLRepresentationPrivate : NSObject
WebView *webView = [frame webView];
if ([webView isEditable])
- [_private->bridge applyEditingStyleToBodyElement];
+ [_private->bridge _frame]->applyEditingStyleToBodyElement();
}
}
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebHTMLView.h>
-
+#import "WebHTMLView.h"
+
+#import "WebArchive.h"
+#import "WebArchiver.h"
+#import "WebBaseNetscapePluginViewInternal.h"
+#import "WebClipView.h"
+#import "WebDOMOperationsPrivate.h"
+#import "WebDataSourceInternal.h"
+#import "WebDefaultUIDelegate.h"
+#import "WebDocumentInternal.h"
+#import "WebEditingDelegate.h"
+#import "WebElementDictionary.h"
+#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
+#import "WebFramePrivate.h"
+#import "WebFrameViewInternal.h"
+#import "WebHTMLRepresentationPrivate.h"
+#import "WebHTMLViewInternal.h"
+#import "WebKitLogging.h"
+#import "WebKitNSStringExtras.h"
+#import "WebLocalizableStrings.h"
+#import "WebNSAttributedStringExtras.h"
+#import "WebNSEventExtras.h"
+#import "WebNSFileManagerExtras.h"
+#import "WebNSImageExtras.h"
+#import "WebNSObjectExtras.h"
+#import "WebNSPasteboardExtras.h"
+#import "WebNSPrintOperationExtras.h"
+#import "WebNSURLExtras.h"
+#import "WebNSViewExtras.h"
+#import "WebNetscapePluginEmbeddedView.h"
+#import "WebPluginController.h"
+#import "WebPreferences.h"
+#import "WebPreferencesPrivate.h"
+#import "WebResourcePrivate.h"
+#import "WebStringTruncator.h"
+#import "WebUIDelegatePrivate.h"
+#import "WebViewInternal.h"
+#import <AppKit/NSAccessibility.h>
#import <ApplicationServices/ApplicationServices.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/WebCoreTextRenderer.h>
+#import <WebCore/WebDataProtocol.h>
#import <WebKit/DOM.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMPrivate.h>
-#import <WebKit/WebArchive.h>
-#import <WebKit/WebArchiver.h>
-#import <WebKit/WebBaseNetscapePluginViewInternal.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebClipView.h>
-#import <WebCore/WebDataProtocol.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebDefaultUIDelegate.h>
-#import <WebKit/WebDocumentInternal.h>
-#import <WebKit/WebDOMOperationsPrivate.h>
-#import <WebKit/WebEditingDelegate.h>
-#import <WebKit/WebElementDictionary.h>
-#import <WebKit/WebFramePrivate.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebFrameViewInternal.h>
-#import <WebKit/WebHTMLViewInternal.h>
-#import <WebKit/WebHTMLRepresentationPrivate.h>
-#import <WebKit/WebKitLogging.h>
-#import <WebKit/WebKitNSStringExtras.h>
-#import <WebKit/WebLocalizableStrings.h>
-#import <WebKit/WebNetscapePluginEmbeddedView.h>
-#import <WebKit/WebNSAttributedStringExtras.h>
-#import <WebKit/WebNSEventExtras.h>
-#import <WebKit/WebNSFileManagerExtras.h>
-#import <WebKit/WebNSImageExtras.h>
-#import <WebKit/WebNSObjectExtras.h>
-#import <WebKit/WebNSPasteboardExtras.h>
-#import <WebKit/WebNSPrintOperationExtras.h>
-#import <WebKit/WebNSURLExtras.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebPluginController.h>
-#import <WebKit/WebPreferences.h>
-#import <WebKit/WebPreferencesPrivate.h>
-#import <WebKit/WebResourcePrivate.h>
-#import <WebKit/WebStringTruncator.h>
-#import <WebKit/WebUIDelegatePrivate.h>
-#import <WebKit/WebViewInternal.h>
#import <WebKitSystemInterface.h>
-#import <WebCore/WebCoreTextRenderer.h>
-
-#import <AppKit/NSAccessibility.h>
-
-// Included so usage of _NSSoftLinkingGetFrameworkFuncPtr will compile
#import <mach-o/dyld.h>
+using namespace WebCore;
+
+extern "C" {
// need to declare this because AppKit does not make it available as API or SPI
extern NSString *NSMarkedClauseSegmentAttributeName;
extern NSString *NSTextInputReplacementRangeAttributeName;
// Kill ring calls. Would be better to use NSKillRing.h, but that's not available in SPI.
+
void _NSInitializeKillRing(void);
void _NSAppendToKillRing(NSString *);
void _NSPrependToKillRing(NSString *);
void _NSSetKillRingToYankedState(void);
void _NSResetKillRingOperationFlag(void);
+}
+
@interface NSView (AppKitSecretsIKnowAbout)
- (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
- (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
static BOOL forceWebHTMLViewHitTest = NO;
// Used to avoid linking with ApplicationServices framework for _DCMDictionaryServiceWindowShow
-void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
- NSString *inFrameworkName,
- const char *inFuncName,
- const struct mach_header **ioCachedFrameworkImageHeaderPtr);
-
+extern "C" void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
+ NSString *inFrameworkName, const char *inFuncName, const struct mach_header **);
@interface WebHTMLView (WebTextSizing) <_WebDocumentTextSizing>
@end
}
// Soft link to dictionary-display function to avoid linking another framework (ApplicationServices/LangAnalysis)
- static OSStatus (*__dictionaryServiceWindowShow)(id inWordString, NSRect inWordBoundary, UInt16 inLineDirection) = NULL;
- static const struct mach_header *frameworkImageHeader = NULL;
- static BOOL lookedForFunction = NO;
+ static bool lookedForFunction = false;
+ typedef OSStatus (*ServiceWindowShowFunction)(id inWordString, NSRect inWordBoundary, UInt16 inLineDirection);
+ static ServiceWindowShowFunction dictionaryServiceWindowShow;
if (!lookedForFunction) {
- __dictionaryServiceWindowShow = _NSSoftLinkingGetFrameworkFuncPtr(@"ApplicationServices", @"LangAnalysis", "_DCMDictionaryServiceWindowShow", &frameworkImageHeader);
- lookedForFunction = YES;
+ const struct mach_header *frameworkImageHeader;
+ dictionaryServiceWindowShow = reinterpret_cast<ServiceWindowShowFunction>(
+ _NSSoftLinkingGetFrameworkFuncPtr(@"ApplicationServices", @"LangAnalysis", "_DCMDictionaryServiceWindowShow", &frameworkImageHeader));
+ lookedForFunction = true;
}
- if (!__dictionaryServiceWindowShow) {
+ if (!dictionaryServiceWindowShow) {
LOG_ERROR("Couldn't find _DCMDictionaryServiceWindowShow");
return;
}
-
+
// FIXME: must check for right-to-left here
NSWritingDirection writingDirection = NSWritingDirectionLeftToRight;
-
+
NSAttributedString *attrString = [self selectedAttributedString];
// FIXME: the dictionary API expects the rect for the first line of selection. Passing
// the rect for the entire selection, as we do here, positions the pop-up window near
NSRect rect = [self convertRect:[[self _bridge] visibleSelectionRect] toView:nil];
rect.origin = [[self window] convertBaseToScreen:rect.origin];
NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil];
- (void)__dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
+ dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
}
- (BOOL)_transparentBackground
{
SEL action = [item action];
WebFrameBridge *bridge = [self _bridge];
+ FrameMac* frame = [bridge _frame];
if (action == @selector(changeSpelling:)
|| action == @selector(_changeSpellingFromMenu:)
if (action == @selector(changeBaseWritingDirection:)) {
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
- NSWritingDirection writingDirection = [item tag];
+ NSWritingDirection writingDirection = static_cast<NSWritingDirection>([item tag]);
if (writingDirection == NSWritingDirectionNatural) {
[menuItem setState:NO];
return NO;
return [[self _webView] isEditable] && [self _canEditRichly];
if (action == @selector(copy:))
- return [bridge mayDHTMLCopy] || [self _canCopy];
+ return (frame && frame->mayDHTMLCopy()) || [self _canCopy];
if (action == @selector(cut:))
- return [bridge mayDHTMLCut] || [self _canCut];
+ return (frame && frame->mayDHTMLCut()) || [self _canCut];
if (action == @selector(delete:))
return [self _canDelete];
return [self _hasSelection];
if (action == @selector(paste:) || action == @selector(pasteAsPlainText:))
- return [bridge mayDHTMLPaste] || [self _canPaste];
+ return (frame && frame->mayDHTMLPaste()) || [self _canPaste];
if (action == @selector(pasteAsRichText:))
- return [bridge mayDHTMLPaste] || ([self _canPaste] && [[self _bridge] isSelectionRichlyEditable]);
+ return (frame && frame->mayDHTMLPaste()) || ([self _canPaste] && [[self _bridge] isSelectionRichlyEditable]);
if (action == @selector(performFindPanelAction:))
// FIXME: Not yet implemented.
- (void)scrollWheel:(NSEvent *)event
{
[self retain];
-
- if (![[self _bridge] sendScrollWheelEvent:event]) {
- [[self nextResponder] scrollWheel:event];
- }
-
+ FrameMac* frame = [[self _bridge] _frame];
+ if (!frame || !frame->wheelEvent(event))
+ [[self nextResponder] scrollWheel:event];
[self release];
}
if (hitHTMLView != nil) {
[hitHTMLView _setMouseDownEvent:event];
[[hitHTMLView _bridge] setActivationEventNumber:[event eventNumber]];
- BOOL result = [hitHTMLView _isSelectionEvent:event] ? [[hitHTMLView _bridge] eventMayStartDrag:event] : NO;
+ bool result = false;
+ if ([hitHTMLView _isSelectionEvent:event])
+ if (FrameMac* frame = [[hitHTMLView _bridge] _frame])
+ result = frame->eventMayStartDrag(event);
[hitHTMLView _setMouseDownEvent:nil];
return result;
- } else
- return [hitView acceptsFirstMouse:event];
+ }
+ return [hitView acceptsFirstMouse:event];
}
- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)event
NSView *hitView = [self _hitViewForEvent:event];
WebHTMLView *hitHTMLView = [hitView isKindOfClass:[self class]] ? (WebHTMLView *)hitView : nil;
if (hitHTMLView != nil) {
- [hitHTMLView _setMouseDownEvent:event];
- BOOL result = [hitHTMLView _isSelectionEvent:event] ? [[hitHTMLView _bridge] eventMayStartDrag:event] : NO;
+ bool result = false;
+ if ([hitHTMLView _isSelectionEvent:event])
+ if (FrameMac* frame = [[hitHTMLView _bridge] _frame])
+ result = frame->eventMayStartDrag(event);
[hitHTMLView _setMouseDownEvent:nil];
return result;
- } else
- return [hitView shouldDelayWindowOrderingForEvent:event];
+ }
+ return [hitView shouldDelayWindowOrderingForEvent:event];
}
- (void)mouseDown:(NSEvent *)event
- (NSData *)_selectionStartFontAttributesAsRTF
{
NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"x"
- attributes:[[self _bridge] fontAttributesForSelectionStart]];
+ attributes:[[self _bridge] _frame]->fontAttributesForSelectionStart()];
NSData *data = [string RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil];
[string release];
return data;
if (![self _canEdit])
return;
- NSWritingDirection writingDirection = [sender tag];
+ NSWritingDirection writingDirection = static_cast<NSWritingDirection>([sender tag]);
// We disable the menu item that performs this action because we can't implement
// NSWritingDirectionNatural's behavior using CSS.
- (void)indent:(id)sender
{
- [[self _bridge] indent];
+ [[self _bridge] _frame]->indent();
}
- (void)outdent:(id)sender
{
- [[self _bridge] outdent];
+ [[self _bridge] _frame]->outdent();
}
#if 0
// It's probably simple to do the equivalent thing for WebKit.
- (void)insertTable:(id)sender;
-// === key binding methods that NSTextView has that don't have standard key bindings
-
-// These could be important.
+// This could be important.
- (void)toggleTraditionalCharacterShape:(id)sender;
// I'm not sure what the equivalents of these in the web world are.
- (void)insertLineSeparator:(id)sender;
- (void)insertPageBreak:(id)sender;
-// === methods not present in NSTextView
-
-// These methods are not implemented in NSTextView yet, so perhaps there's no rush.
+// These methods are not implemented in NSTextView yet at the time of this writing.
- (void)changeCaseOfLetter:(id)sender;
- (void)transposeWords:(id)sender;
- (void)copy:(id)sender
{
- if ([[self _bridge] tryDHTMLCopy])
+ FrameMac* frame = [[self _bridge] _frame];
+ if (frame && frame->tryDHTMLCopy())
return; // DHTML did the whole operation
if (![self _canCopy]) {
NSBeep();
- (void)cut:(id)sender
{
WebFrameBridge *bridge = [self _bridge];
- if ([bridge tryDHTMLCut])
+ FrameMac* frame = [bridge _frame];
+ if (frame && frame->tryDHTMLCut())
return; // DHTML did the whole operation
if (![self _canCut]) {
NSBeep();
- (void)paste:(id)sender
{
- if ([[self _bridge] tryDHTMLPaste])
- return; // DHTML did the whole operation
+ WebFrameBridge *bridge = [self _bridge];
+ FrameMac* frame = [bridge _frame];
+ if (frame && frame->tryDHTMLPaste())
+ return; // DHTML did the whole operation
if (![self _canPaste])
return;
- if ([[self _bridge] isSelectionRichlyEditable])
+ if ([bridge isSelectionRichlyEditable])
[self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
else
[self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]];
#import <CoreFoundation/CFSet.h>
#import <Foundation/NSURLConnection.h>
#import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameMac.h>
#import <WebCore/WebCoreEncodings.h>
#import <WebCore/WebCoreFrameBridge.h>
#import <WebCore/WebCoreSettings.h>
- (NSDictionary *)_dashboardRegions
{
// Only return regions from main frame.
- NSMutableDictionary *regions = [[[self mainFrame] _bridge] dashboardRegions];
+ FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+ if (!mainFrame)
+ return nil;
+ NSMutableDictionary *regions = mainFrame->dashboardRegionsDictionary();
[self _addScrollerDashboardRegions:regions];
return regions;
}
- (void)setProhibitsMainFrameScrolling:(BOOL)prohibits
{
- [[[self mainFrame] _bridge] setProhibitsScrolling:YES];
+ FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+ if (mainFrame)
+ mainFrame->setProhibitsScrolling(prohibits);
}
- (BOOL)alwaysShowHorizontalScroller
- (void)_setInViewSourceMode:(BOOL)flag
{
- [[[self mainFrame] _bridge] setInViewSourceMode:flag];
+ FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+ if (mainFrame)
+ mainFrame->setInViewSourceMode(flag);
}
- (BOOL)_inViewSourceMode
{
- return [[[self mainFrame] _bridge] inViewSourceMode];
+ FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+ return mainFrame && mainFrame->inViewSourceMode();
}
- (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths
_private->editable = flag;
if (!_private->tabKeyCyclesThroughElementsChanged)
_private->tabKeyCyclesThroughElements = !flag;
- WebFrameBridge *bridge = [[self mainFrame] _bridge];
- if (flag) {
- [bridge applyEditingStyleToBodyElement];
- // If the WebView is made editable and the selection is empty, set it to something.
- if (![self selectedDOMRange])
- [bridge setSelectionFromNone];
- } else
- [bridge removeEditingStyleFromBodyElement];
+ FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+ if (mainFrame) {
+ if (flag) {
+ mainFrame->applyEditingStyleToBodyElement();
+ // If the WebView is made editable and the selection is empty, set it to something.
+ if (![self selectedDOMRange])
+ mainFrame->setSelectionFromNone();
+ } else
+ mainFrame->removeEditingStyleFromBodyElement();
+ }
}
}