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

Issue 113746: Overhaul omnibox focus detection on Mac. (Closed)

Created:
11 years, 7 months ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Overhaul omnibox focus detection on Mac. Rather than aiming to detect acquisition and loss of focus in |field_|, just acknowledge that there are cases where |field_| has focus but |model_| doesn't know. If |field_| has focus but no editing has been done, then |model_| will take no action, so this is reasonable. Window resigning key just closes the popup, and doesn't affect |model_| focus. Thus, there is no need to deal with acquiring focus when the window becomes key again, and we can live fine within the constraints of -*DidBeginEditing: and -*ShouldEndEditing:. Added checks for |field_| being focussed in all the relevant places. http://crbug.com/12338

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address Pink's suggestion, add some color commentary. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -28 lines) Patch
M chrome/browser/autocomplete/autocomplete_edit_view_mac.h View 1 2 chunks +19 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_mac.mm View 1 8 chunks +68 lines, -23 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Scott Hess - ex-Googler
I think this is good to go, but I need to step back and think ...
11 years, 7 months ago (2009-05-21 23:42:06 UTC) #1
pink (ping after 24hrs)
LGTM http://codereview.chromium.org/113746/diff/1/2 File chrome/browser/autocomplete/autocomplete_edit_view_mac.h (right): http://codereview.chromium.org/113746/diff/1/2#newcode90 Line 90: void OnDidBeginEditing(); if it comes before anything ...
11 years, 7 months ago (2009-05-22 13:09:28 UTC) #2
Scott Hess - ex-Googler
11 years, 7 months ago (2009-05-22 17:15:20 UTC) #3
Also added some commentary around focus handling.

http://codereview.chromium.org/113746/diff/1/2
File chrome/browser/autocomplete/autocomplete_edit_view_mac.h (right):

http://codereview.chromium.org/113746/diff/1/2#newcode90
Line 90: void OnDidBeginEditing();
On 2009/05/22 13:09:28, pink wrote:
> if it comes before anything is communicated to the model, should it be called
> OnWillBeginEditing()? *shrug*

Was named after the ObjC method, -controlTextDidBeginEditing:.  Seems like a
tossup, but Will does seem closer to the intent, so Done.

http://codereview.chromium.org/113746/diff/1/3
File chrome/browser/autocomplete/autocomplete_edit_view_mac.mm (right):

http://codereview.chromium.org/113746/diff/1/3#newcode478
Line 478: // can detect that without subclassing NSTextField.
On 2009/05/22 13:09:28, pink wrote:
> Can you can get [NSEvent currentEvent] and check for the control key?

Definitely could.  For now, I'd rather callout places where it matters, but not
actually address it, because I don't think the modifications Control makes to
autocomplete are probably MacDev material.

On Windows results change on depress/release of Control, not on the next input. 
So I think that really implementing that feature will require more than what I
can intercept in a target/delegate type object.

Powered by Google App Engine
This is Rietveld 408576698