Reviewed by Maciej.
WebCore part of fix for <rdar://problem/
4450613> need a means to attach user data to any menu that is popuped up in HTML
Added private delegate method for clients that want access to a PopupMenu's NSMenu.
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm: (WebCore::FrameMac::willPopupMenu):
* bridge/mac/WebCoreFrameBridge.h:
* platform/mac/PopupMenuMac.mm: (WebCore::PopupMenu::show): Calls willPopupMenu with the NSMenu about to be popped up.
WebKit:
Reviewed by Maciej.
WebKit part of fix for <rdar://problem/
4450613> need a means to attach user data to any menu that is popuped up in HTML
Added private delegate method for clients that want access to a PopupMenu's NSMenu.
* DefaultDelegates/WebDefaultUIDelegate.m: (-[NSApplication webView:willPopupMenu:]):
* WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge willPopupMenu:]):
* WebView/WebUIDelegatePrivate.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17023
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-12 Adele Peterson <adele@apple.com>
+
+ Reviewed by Maciej.
+
+ WebCore part of fix for <rdar://problem/4450613> need a means to attach user data to any menu that is popuped up in HTML
+
+ Added private delegate method for clients that want access to a PopupMenu's NSMenu.
+
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm: (WebCore::FrameMac::willPopupMenu):
+ * bridge/mac/WebCoreFrameBridge.h:
+
+ * platform/mac/PopupMenuMac.mm: (WebCore::PopupMenu::show): Calls willPopupMenu with the NSMenu about to be popped up.
+
2006-10-12 Adele Peterson <adele@apple.com>
Reviewed by Alice.
@class NSFileWrapper;
@class NSFont;
@class NSImage;
+@class NSMenu;
@class NSMutableDictionary;
@class NSResponder;
@class NSString;
class NSFileWrapper;
class NSFont;
class NSImage;
+class NSMenu;
class NSMutableDictionary;
class NSResponder;
class NSString;
NSMutableDictionary* dashboardRegionsDictionary();
void dashboardRegionsChanged();
+
+ void willPopupMenu(NSMenu *);
virtual bool isCharacterSmartReplaceExempt(UChar, bool);
[_bridge dashboardRegionsChanged:webRegions];
}
+void FrameMac::willPopupMenu(NSMenu * menu)
+{
+ [_bridge willPopupMenu:menu];
+}
+
bool FrameMac::isCharacterSmartReplaceExempt(UChar c, bool isPreviousChar)
{
return [_bridge isCharacterSmartReplaceExempt:c isPreviousCharacter:isPreviousChar];
#else
+@class NSMenu;
@class WebCoreMacFrame;
@class WebCoreElement;
@class DOMHTMLTextAreaElement;
@class DOMNode;
@class DOMRange;
+@class NSMenu;
@class WebCorePageBridge;
@class WebCoreSettings;
@class WebFrame;
- (void)didFirstLayout;
- (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
+- (void)willPopupMenu:(NSMenu *)menu;
- (NSRect)customHighlightRect:(NSString*)type forLine:(NSRect)lineRect;
- (void)paintCustomHighlight:(NSString*)type forBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line;
NSEvent* event = [frame->currentEvent() retain];
RefPtr<PopupMenu> protector(this);
+
+ frame->willPopupMenu(menu);
wkPopupMenu(menu, location, roundf(NSWidth(r)), view, index, font);
if (menuList()) {
+2006-10-12 Adele Peterson <adele@apple.com>
+
+ Reviewed by Maciej.
+
+ WebKit part of fix for <rdar://problem/4450613> need a means to attach user data to any menu that is popuped up in HTML
+
+ Added private delegate method for clients that want access to a PopupMenu's NSMenu.
+
+ * DefaultDelegates/WebDefaultUIDelegate.m: (-[NSApplication webView:willPopupMenu:]):
+ * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge willPopupMenu:]):
+ * WebView/WebUIDelegatePrivate.h:
+
2006-10-12 MorganL <morganl.webkit@yahoo.com>
Reviewed/landed by Adam.
{
}
+- (void)webView:(WebView *)sender willPopupMenu:(NSMenu *)menu
+{
+}
+
@end
}
}
+- (void)willPopupMenu:(NSMenu *)menu
+{
+ WebView *wv = [self webView];
+ id wd = [wv UIDelegate];
+
+ if ([wd respondsToSelector:@selector(webView:willPopupMenu:)])
+ [wd webView:wv willPopupMenu:menu];
+}
+
- (NSRect)customHighlightRect:(NSString*)type forLine:(NSRect)lineRect
{
ASSERT(_frame != nil);
- (void)webView:(WebView *)sender didDrawRect:(NSRect)rect;
- (void)webView:(WebView *)sender didScrollDocumentInFrameView:(WebFrameView *)frameView;
- (BOOL)webViewShouldInterruptJavaScript:(WebView *)sender;
+- (void)webView:(WebView *)sender willPopupMenu:(NSMenu *)menu;
@end