| 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 30 matching lines...) Expand all Loading... |
| 41 // Called when the user pastes into the field. | 41 // Called when the user pastes into the field. |
| 42 virtual void OnPaste() = 0; | 42 virtual void OnPaste() = 0; |
| 43 | 43 |
| 44 // Return |true| if there is a selection to copy. | 44 // Return |true| if there is a selection to copy. |
| 45 virtual bool CanCopy() = 0; | 45 virtual bool CanCopy() = 0; |
| 46 | 46 |
| 47 // Clears the |pboard| and adds the field's current selection. | 47 // Clears the |pboard| and adds the field's current selection. |
| 48 // Called when the user does a copy or drag. | 48 // Called when the user does a copy or drag. |
| 49 virtual void CopyToPasteboard(NSPasteboard* pboard) = 0; | 49 virtual void CopyToPasteboard(NSPasteboard* pboard) = 0; |
| 50 | 50 |
| 51 // Clears |pboard| and adds the current URL. Specifically used when the user |
| 52 // explicitly requests to copy the URL in cases where extended instant has |
| 53 // overridden the URL with the search terms. |
| 54 virtual void CopyURLToPasteboard(NSPasteboard* pboard) = 0; |
| 55 |
| 56 // Returns true if the Copy to URL option should be available. |
| 57 virtual bool ShouldAddCopyURL() = 0; |
| 58 |
| 51 // Returns true if the current clipboard text supports paste and go | 59 // Returns true if the current clipboard text supports paste and go |
| 52 // (or paste and search). | 60 // (or paste and search). |
| 53 virtual bool CanPasteAndGo() = 0; | 61 virtual bool CanPasteAndGo() = 0; |
| 54 | 62 |
| 55 // Returns the appropriate "Paste and Go" or "Paste and Search" | 63 // Returns the appropriate "Paste and Go" or "Paste and Search" |
| 56 // context menu string, depending on what is currently in the | 64 // context menu string, depending on what is currently in the |
| 57 // clipboard. Must not be called unless CanPasteAndGo() returns | 65 // clipboard. Must not be called unless CanPasteAndGo() returns |
| 58 // true. | 66 // true. |
| 59 virtual int GetPasteActionStringId() = 0; | 67 virtual int GetPasteActionStringId() = 0; |
| 60 | 68 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Return the appropriate menu for any decoration under |event|. | 145 // Return the appropriate menu for any decoration under |event|. |
| 138 - (NSMenu*)decorationMenuForEvent:(NSEvent*)event; | 146 - (NSMenu*)decorationMenuForEvent:(NSEvent*)event; |
| 139 | 147 |
| 140 // Retains |tooltip| (in |currentToolTips_|) and adds this tooltip | 148 // Retains |tooltip| (in |currentToolTips_|) and adds this tooltip |
| 141 // via -[NSView addToolTipRect:owner:userData:]. | 149 // via -[NSView addToolTipRect:owner:userData:]. |
| 142 - (void)addToolTip:(NSString*)tooltip forRect:(NSRect)aRect; | 150 - (void)addToolTip:(NSString*)tooltip forRect:(NSRect)aRect; |
| 143 | 151 |
| 144 @end | 152 @end |
| 145 | 153 |
| 146 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 154 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| OLD | NEW |