diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 16:39:04 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 16:39:04 +0000 |
commit | 46c9d5058bf1ffab71810be72669b97cd8997319 (patch) | |
tree | 90e841276a608b597dbd2e2801606aede3f93130 /chrome | |
parent | 0e7b94e4f8ac26a855b0d22a31b1337ab3bc195a (diff) | |
download | chromium_src-46c9d5058bf1ffab71810be72669b97cd8997319.zip chromium_src-46c9d5058bf1ffab71810be72669b97cd8997319.tar.gz chromium_src-46c9d5058bf1ffab71810be72669b97cd8997319.tar.bz2 |
[Mac] AcceptInput() doesn't really need focus (as when called via "Go" button).
http://crbug.com/15811
TEST=Browse to www.google.com. Focus is in document. Click Go. No more crash.
Review URL: http://codereview.chromium.org/149487
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm index 71c11b0..9fe6ab9 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm @@ -290,9 +290,11 @@ NSRange AutocompleteEditViewMac::GetSelectedRange() const { } void AutocompleteEditViewMac::SetSelectedRange(const NSRange range) { + // This can be called when we don't have focus. For instance, when + // the user clicks the "Go" button. if (model_->has_focus()) { - // TODO(shess): This should not be necessary. Try to convert to - // DCHECK(IsFirstResponder()). + // TODO(shess): If |model_| thinks we have focus, this should not + // be necessary. Try to convert to DCHECK(IsFirstResponder()). FocusLocation(); // TODO(shess): What if it didn't get first responder, and there is @@ -543,9 +545,6 @@ void AutocompleteEditViewMac::OnDidResignKey() { void AutocompleteEditViewMac::AcceptInput( WindowOpenDisposition disposition, bool for_drop) { - // We should only arrive here when the field is focussed. - DCHECK([field_ currentEditor]); - model_->AcceptInput(disposition, for_drop); } |