OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
6 #define CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // field's window loses focus or a page action is clicked. | 77 // field's window loses focus or a page action is clicked. |
78 virtual void ClosePopup() = 0; | 78 virtual void ClosePopup() = 0; |
79 | 79 |
80 // Called when the user begins editing the field, for every edit, | 80 // Called when the user begins editing the field, for every edit, |
81 // and when the user is done editing the field. | 81 // and when the user is done editing the field. |
82 virtual void OnDidBeginEditing() = 0; | 82 virtual void OnDidBeginEditing() = 0; |
83 virtual void OnBeforeChange() = 0; | 83 virtual void OnBeforeChange() = 0; |
84 virtual void OnDidChange() = 0; | 84 virtual void OnDidChange() = 0; |
85 virtual void OnDidEndEditing() = 0; | 85 virtual void OnDidEndEditing() = 0; |
86 | 86 |
87 // Called before input methods sets composition text in the field. | |
88 virtual void OnStartingIME() = 0; | |
89 | |
90 // NSResponder translates certain keyboard actions into selectors | 87 // NSResponder translates certain keyboard actions into selectors |
91 // passed to -doCommandBySelector:. The selector is forwarded here, | 88 // passed to -doCommandBySelector:. The selector is forwarded here, |
92 // return true if |cmd| is handled, false if the caller should | 89 // return true if |cmd| is handled, false if the caller should |
93 // handle it. | 90 // handle it. |
94 // TODO(shess): For now, I think having the code which makes these | 91 // TODO(shess): For now, I think having the code which makes these |
95 // decisions closer to the other autocomplete code is worthwhile, | 92 // decisions closer to the other autocomplete code is worthwhile, |
96 // since it calls a wide variety of methods which otherwise aren't | 93 // since it calls a wide variety of methods which otherwise aren't |
97 // clearly relevent to expose here. But consider pulling more of | 94 // clearly relevent to expose here. But consider pulling more of |
98 // the OmniboxViewMac calls up to here. | 95 // the OmniboxViewMac calls up to here. |
99 virtual bool OnDoCommandBySelector(SEL cmd) = 0; | 96 virtual bool OnDoCommandBySelector(SEL cmd) = 0; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Draw instant suggestion text in |controlView|. | 168 // Draw instant suggestion text in |controlView|. |
172 void DrawInstantSuggestion(NSAttributedString* mainText, | 169 void DrawInstantSuggestion(NSAttributedString* mainText, |
173 NSString* suggestText, | 170 NSString* suggestText, |
174 NSColor* suggestColor, | 171 NSColor* suggestColor, |
175 NSView* controlView, | 172 NSView* controlView, |
176 NSRect frame); | 173 NSRect frame); |
177 | 174 |
178 } // namespace autocomplete_text_field | 175 } // namespace autocomplete_text_field |
179 | 176 |
180 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 177 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
OLD | NEW |