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

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

Issue 113746: Overhaul omnibox focus detection on Mac. (Closed)
Patch Set: Address Pink's suggestion, add some color commentary. Created 11 years, 7 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 | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_mac.h
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
index e8d00fbf477f1aba6a1f92b5de32ae076c43590c..aec861ce20ddc3feab6a24bc9c22a15c4904e962 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
@@ -80,13 +80,22 @@ class AutocompleteEditViewMac : public AutocompleteEditView {
virtual void OnBeforePossibleChange();
virtual bool OnAfterPossibleChange();
- // Helper functions which forward to |model_|, for use from
- // AutocompleteEditHelper Objective-C class.
+ // Helper functions for use from AutocompleteEditHelper Objective-C
+ // class.
void OnUpOrDownKeyPressed(bool up, bool by_page);
void OnEscapeKeyPressed();
- // Only forwards to |model_| if the field_ has focus.
- void OnSetFocus(bool f);
- void OnKillFocus();
+
+ // Called when editing begins in the field, and before the results
+ // of any editing are communicated to |model_|.
+ void OnWillBeginEditing();
+
+ // Called when editing ends in the field.
+ void OnDidEndEditing();
+
+ // Called when the window |field_| is in loses key to clean up
+ // visual state (such as closing the popup).
+ void OnDidResignKey();
+
void AcceptInput(WindowOpenDisposition disposition, bool for_drop);
// Helper for LocationBarBridge.
@@ -97,6 +106,11 @@ class AutocompleteEditViewMac : public AutocompleteEditView {
// field has focus.
NSRange GetSelectedRange() const;
+ // Returns true if |field_| is first-responder in the window. Used
+ // in various DCHECKS to make sure code is running in appropriate
+ // situations.
+ bool IsFirstResponder() const;
+
// Grab focus if needed and set the selection to |range|.
void SetSelectedRange(const NSRange range);
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698