Commit 729c76b9 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Mac: Forward all messages from window delegates to TabWindowController

In https://chromium-review.googlesource.com/c/chromium/src/+/852978,
TabWindowController was changed to no longer subclass NSWindowController.
But, since many callers assumed that a browser window's window controller
was also its delegate, the new window controller proxies NSWindowDelegate
methods to the TabWindowController.

Unfortunately, it turns out that callers also make assumptions about the
delegate, and if we only forward NSWindowDelegate methods, some fall
through the cracks.

This change removes the NSWindowDelegate check from the forwarding code,
to ensure that TabWindowController receives all method calls meant for it.

Bug: 835296
Change-Id: Ia16b8018c7c110e44a34b0f4cb1a636a143c3415
Reviewed-on: https://chromium-review.googlesource.com/1040945Reviewed-by: default avatarSidney San Martín <sdy@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555720}
parent 1760ef3d
......@@ -47,16 +47,7 @@
if ([super respondsToSelector:aSelector]) {
return YES;
}
// Only forward methods from the NSWindowDelegate protcol.
Protocol* nsWindowDelegateProtocol = objc_getProtocol("NSWindowDelegate");
struct objc_method_description methodDescription =
protocol_getMethodDescription(nsWindowDelegateProtocol, aSelector, NO,
YES);
return methodDescription.name
? [self.tabWindowController respondsToSelector:aSelector]
: NO;
return [self.tabWindowController respondsToSelector:aSelector];
}
- (NSMethodSignature*)methodSignatureForSelector:(SEL)aSelector {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment