| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Called when editing ends in the field. | 105 // Called when editing ends in the field. |
| 106 void OnDidEndEditing(); | 106 void OnDidEndEditing(); |
| 107 | 107 |
| 108 // Called when the window |field_| is in loses key to clean up | 108 // Called when the window |field_| is in loses key to clean up |
| 109 // visual state (such as closing the popup). | 109 // visual state (such as closing the popup). |
| 110 void OnDidResignKey(); | 110 void OnDidResignKey(); |
| 111 | 111 |
| 112 // Called when the user attempts to paste into |field_|. | 112 // Called when the user attempts to paste into |field_|. |
| 113 void OnPaste(); | 113 void OnPaste(); |
| 114 | 114 |
| 115 // Checks if a keyword search is possible and forwards to |model_| |
| 116 // if so. Returns true if the tab should be eaten. |
| 117 bool OnTabPressed(); |
| 118 |
| 115 void AcceptInput(WindowOpenDisposition disposition, bool for_drop); | 119 void AcceptInput(WindowOpenDisposition disposition, bool for_drop); |
| 116 | 120 |
| 117 // Forwards to |model_| when user hits Tab. | |
| 118 void AcceptKeyword(); | |
| 119 | |
| 120 // Helper for LocationBarViewMac. Selects all in |field_|. | 121 // Helper for LocationBarViewMac. Selects all in |field_|. |
| 121 void FocusLocation(); | 122 void FocusLocation(); |
| 122 | 123 |
| 123 // Helper to get appropriate contents from |clipboard|. Returns | 124 // Helper to get appropriate contents from |clipboard|. Returns |
| 124 // empty string if no appropriate data is found on |clipboard|. | 125 // empty string if no appropriate data is found on |clipboard|. |
| 125 static std::wstring GetClipboardText(Clipboard* clipboard); | 126 static std::wstring GetClipboardText(Clipboard* clipboard); |
| 126 | 127 |
| 127 private: | 128 private: |
| 128 // Returns the field's currently selected range. Only valid if the | 129 // Returns the field's currently selected range. Only valid if the |
| 129 // field has focus. | 130 // field has focus. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 174 |
| 174 // Tracking state before and after a possible change for reporting | 175 // Tracking state before and after a possible change for reporting |
| 175 // to model_. | 176 // to model_. |
| 176 NSRange selection_before_change_; | 177 NSRange selection_before_change_; |
| 177 std::wstring text_before_change_; | 178 std::wstring text_before_change_; |
| 178 | 179 |
| 179 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); | 180 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); |
| 180 }; | 181 }; |
| 181 | 182 |
| 182 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 183 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
| OLD | NEW |