Description-[AutocompleteTextFieldEditor delegate] cleanup.
AutocompleteTextFieldEditor* requires its delegate to be an
AutocompleteTextField*. Override the return type of -delegate and the
parameter type of -setDelegate:. This is safe because NSTextView,
AutocompleteTextFieldEditor's superclass, uses id<NSTextViewDelegate> as the
delegate type (as of the 10.6 SDK, and just id prior), and
AutocompleteTextField* implements NSTextViewDelegate (and of course is
descended from id).
This change allows some casts and scattered type checks in this file to be
removed in favor of the cast and type check in one central location. It also
fixes another 10.6 SDK build error caused because -delegate is more specific
than just id in that SDK. It provides future-proofing against further errors
of this sort.
BUG=none
TEST=10.6 SDK build
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=43083
Patch Set 1 #
Messages
Total messages: 2 (0 generated)
|