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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm

Issue 149487: [Mac] AcceptInput() doesn't really need focus (as when called via "Go" button). (Closed)
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698