Index: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm |
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm |
index df8eb53d26214e43a387a862f2cbe6bf7ded60a2..3df744b9c66b212d3caff3188232bea57b2c12fa 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 |
@@ -554,9 +556,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); |
} |