| 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/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Called when the control-key state changes while the field is | 38 // Called when the control-key state changes while the field is |
| 39 // first responder. | 39 // first responder. |
| 40 virtual void OnControlKeyChanged(bool pressed) = 0; | 40 virtual void OnControlKeyChanged(bool pressed) = 0; |
| 41 | 41 |
| 42 // Called when the user pastes into the field. | 42 // Called when the user pastes into the field. |
| 43 virtual void OnPaste() = 0; | 43 virtual void OnPaste() = 0; |
| 44 | 44 |
| 45 // Return |true| if there is a selection to copy. | 45 // Return |true| if there is a selection to copy. |
| 46 virtual bool CanCopy() = 0; | 46 virtual bool CanCopy() = 0; |
| 47 | 47 |
| 48 // Clears the |pboard| and adds the field's current selection. | 48 // Creates a pasteboard item from the field's current selection. |
| 49 // Called when the user does a copy or drag. | 49 virtual base::scoped_nsobject<NSPasteboardItem> CreatePasteboardItem() = 0; |
| 50 |
| 51 // Copies the pasteboard item returned from |CreatePasteboardItem()| to |
| 52 // |pboard|. |
| 50 virtual void CopyToPasteboard(NSPasteboard* pboard) = 0; | 53 virtual void CopyToPasteboard(NSPasteboard* pboard) = 0; |
| 51 | 54 |
| 52 // Returns true if the Show URL option should be available. | 55 // Returns true if the Show URL option should be available. |
| 53 virtual bool ShouldEnableShowURL() = 0; | 56 virtual bool ShouldEnableShowURL() = 0; |
| 54 | 57 |
| 55 // Shows the underlying URL. See OmniboxView::ShowURL(). | 58 // Shows the underlying URL. See OmniboxView::ShowURL(). |
| 56 virtual void ShowURL() = 0; | 59 virtual void ShowURL() = 0; |
| 57 | 60 |
| 58 // Returns true if the current clipboard text supports paste and go | 61 // Returns true if the current clipboard text supports paste and go |
| 59 // (or paste and search). | 62 // (or paste and search). |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Draw gray text suggestion in |controlView|. | 192 // Draw gray text suggestion in |controlView|. |
| 190 void DrawGrayTextAutocompletion(NSAttributedString* mainText, | 193 void DrawGrayTextAutocompletion(NSAttributedString* mainText, |
| 191 NSString* suggestText, | 194 NSString* suggestText, |
| 192 NSColor* suggestColor, | 195 NSColor* suggestColor, |
| 193 NSView* controlView, | 196 NSView* controlView, |
| 194 NSRect frame); | 197 NSRect frame); |
| 195 | 198 |
| 196 } // namespace autocomplete_text_field | 199 } // namespace autocomplete_text_field |
| 197 | 200 |
| 198 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 201 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| OLD | NEW |