Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Issue 1550002: -[AutocompleteTextFieldEditor delegate] cleanup (Closed)

Created:
10 years, 9 months ago by Mark Mentovai
Modified:
9 years, 7 months ago
CC:
chromium-reviews, John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -10 lines) Patch
M chrome/browser/cocoa/autocomplete_text_field_editor.h View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/autocomplete_text_field_editor.mm View 3 chunks +15 lines, -10 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Mark Mentovai
10 years, 9 months ago (2010-03-29 16:24:59 UTC) #1
Scott Hess - ex-Googler
10 years, 9 months ago (2010-03-29 23:27:09 UTC) #2
LGTM.  thx

Powered by Google App Engine
This is Rietveld 408576698