OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 virtual void UpdatePopup(); | 73 virtual void UpdatePopup(); |
74 virtual void ClosePopup(); | 74 virtual void ClosePopup(); |
75 virtual void OnTemporaryTextMaybeChanged(const std::wstring& display_text, | 75 virtual void OnTemporaryTextMaybeChanged(const std::wstring& display_text, |
76 bool save_original_selection); | 76 bool save_original_selection); |
77 virtual bool OnInlineAutocompleteTextMaybeChanged( | 77 virtual bool OnInlineAutocompleteTextMaybeChanged( |
78 const std::wstring& display_text, size_t user_text_length); | 78 const std::wstring& display_text, size_t user_text_length); |
79 virtual void OnRevertTemporaryText(); | 79 virtual void OnRevertTemporaryText(); |
80 virtual void OnBeforePossibleChange(); | 80 virtual void OnBeforePossibleChange(); |
81 virtual bool OnAfterPossibleChange(); | 81 virtual bool OnAfterPossibleChange(); |
82 | 82 |
83 // Helper functions which forward to our private: model_. | 83 // Helper functions which forward to |model_|, for use from |
| 84 // AutocompleteEditHelper Objective-C class. |
84 void OnUpOrDownKeyPressed(bool up, bool by_page); | 85 void OnUpOrDownKeyPressed(bool up, bool by_page); |
85 void OnEscapeKeyPressed(); | 86 void OnEscapeKeyPressed(); |
| 87 // Only forwards to |model_| if the field_ has focus. |
86 void OnSetFocus(bool f); | 88 void OnSetFocus(bool f); |
87 void OnKillFocus(); | 89 void OnKillFocus(); |
88 void AcceptInput(WindowOpenDisposition disposition, bool for_drop); | 90 void AcceptInput(WindowOpenDisposition disposition, bool for_drop); |
89 | 91 |
90 // Helper for LocationBarBridge. | 92 // Helper for LocationBarBridge. |
91 void FocusLocation(); | 93 void FocusLocation(); |
92 | 94 |
93 private: | 95 private: |
94 // Returns the field's currently selected range. Only valid if the | 96 // Returns the field's currently selected range. Only valid if the |
95 // field has focus. | 97 // field has focus. |
(...skipping 28 matching lines...) Expand all Loading... |
124 | 126 |
125 // Tracking state before and after a possible change for reporting | 127 // Tracking state before and after a possible change for reporting |
126 // to model_. | 128 // to model_. |
127 NSRange selection_before_change_; | 129 NSRange selection_before_change_; |
128 std::wstring text_before_change_; | 130 std::wstring text_before_change_; |
129 | 131 |
130 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); | 132 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); |
131 }; | 133 }; |
132 | 134 |
133 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 135 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
OLD | NEW |