| 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_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 5 #ifndef CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| 6 #define CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 6 #define CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 @class AutocompleteTextFieldCell; | 10 @class AutocompleteTextFieldCell; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Returns the appropriate "Paste and Go" or "Paste and Search" | 43 // Returns the appropriate "Paste and Go" or "Paste and Search" |
| 44 // context menu string, depending on what is currently in the | 44 // context menu string, depending on what is currently in the |
| 45 // clipboard. Must not be called unless CanPasteAndGo() returns | 45 // clipboard. Must not be called unless CanPasteAndGo() returns |
| 46 // true. | 46 // true. |
| 47 virtual int GetPasteActionStringId() = 0; | 47 virtual int GetPasteActionStringId() = 0; |
| 48 | 48 |
| 49 // Called when the user initiates a "paste and go" or "paste and | 49 // Called when the user initiates a "paste and go" or "paste and |
| 50 // search" into |field_|. | 50 // search" into |field_|. |
| 51 virtual void OnPasteAndGo() = 0; | 51 virtual void OnPasteAndGo() = 0; |
| 52 | 52 |
| 53 // Called when the user clicks the hint icon (i.e. the security icon) in the | |
| 54 // location bar. | |
| 55 virtual void OnSecurityIconClicked() = 0; | |
| 56 | |
| 57 // Called when the field's frame changes. | 53 // Called when the field's frame changes. |
| 58 virtual void OnFrameChanged() = 0; | 54 virtual void OnFrameChanged() = 0; |
| 59 }; | 55 }; |
| 60 | 56 |
| 61 @interface AutocompleteTextField : NSTextField { | 57 @interface AutocompleteTextField : NSTextField { |
| 62 @private | 58 @private |
| 63 AutocompleteTextFieldObserver* observer_; // weak, owned by location bar. | 59 AutocompleteTextFieldObserver* observer_; // weak, owned by location bar. |
| 64 } | 60 } |
| 65 | 61 |
| 66 @property AutocompleteTextFieldObserver* observer; | 62 @property AutocompleteTextFieldObserver* observer; |
| 67 | 63 |
| 68 // Convenience method to return the cell, casted appropriately. | 64 // Convenience method to return the cell, casted appropriately. |
| 69 - (AutocompleteTextFieldCell*)autocompleteTextFieldCell; | 65 - (AutocompleteTextFieldCell*)autocompleteTextFieldCell; |
| 70 | 66 |
| 71 // If the keyword, keyword hint, or search hint changed, then the | 67 // If the keyword, keyword hint, or search hint changed, then the |
| 72 // field editor may need to be repositioned. | 68 // field editor may need to be repositioned. |
| 73 - (void)resetFieldEditorFrameIfNeeded; | 69 - (void)resetFieldEditorFrameIfNeeded; |
| 74 | 70 |
| 75 // Returns the amount of the field's width which is not being taken up | 71 // Returns the amount of the field's width which is not being taken up |
| 76 // by the text contents. May be negative if the contents are large | 72 // by the text contents. May be negative if the contents are large |
| 77 // enough to scroll. | 73 // enough to scroll. |
| 78 - (CGFloat)availableDecorationWidth; | 74 - (CGFloat)availableDecorationWidth; |
| 79 | 75 |
| 80 @end | 76 @end |
| 81 | 77 |
| 82 #endif // CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 78 #endif // CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| OLD | NEW |