| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 8 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 9 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
| 9 | 10 |
| 10 @class AutocompleteTextField; | 11 @class AutocompleteTextField; |
| 11 class AutocompleteTextFieldObserver; | 12 class AutocompleteTextFieldObserver; |
| 12 | 13 |
| 13 // AutocompleteTextFieldEditor customized the AutocompletTextField | 14 // AutocompleteTextFieldEditor customized the AutocompletTextField |
| 14 // field editor (helper text-view used in editing). It intercepts UI | 15 // field editor (helper text-view used in editing). It intercepts UI |
| 15 // events for forwarding to the core Omnibox code. It also undoes | 16 // events for forwarding to the core Omnibox code. It also undoes |
| 16 // some of the effects of using styled text in the Omnibox (the text | 17 // some of the effects of using styled text in the Omnibox (the text |
| 17 // is styled but should not appear that way when copied to the | 18 // is styled but should not appear that way when copied to the |
| 18 // pasteboard). | 19 // pasteboard). |
| 19 | 20 |
| 20 // Field editor used for the autocomplete field. | 21 // Field editor used for the autocomplete field. |
| 21 @interface AutocompleteTextFieldEditor : NSTextView<URLDropTarget> { | 22 @interface AutocompleteTextFieldEditor : NSTextView<URLDropTarget, |
| 23 ThemedWindowDrawing> { |
| 22 // Handles being a drag-and-drop target. We handle DnD directly instead | 24 // Handles being a drag-and-drop target. We handle DnD directly instead |
| 23 // allowing the |AutocompletTextField| to handle it (by making an empty | 25 // allowing the |AutocompletTextField| to handle it (by making an empty |
| 24 // |-updateDragTypeRegistration|), since the latter results in a weird | 26 // |-updateDragTypeRegistration|), since the latter results in a weird |
| 25 // start-up time regression. | 27 // start-up time regression. |
| 26 base::scoped_nsobject<URLDropTargetHandler> dropHandler_; | 28 base::scoped_nsobject<URLDropTargetHandler> dropHandler_; |
| 27 | 29 |
| 28 base::scoped_nsobject<NSCharacterSet> forbiddenCharacters_; | 30 base::scoped_nsobject<NSCharacterSet> forbiddenCharacters_; |
| 29 | 31 |
| 30 // Indicates if the field editor's interpretKeyEvents: method is being called. | 32 // Indicates if the field editor's interpretKeyEvents: method is being called. |
| 31 // If it's YES, then we should postpone the call to the observer's | 33 // If it's YES, then we should postpone the call to the observer's |
| (...skipping 16 matching lines...) Expand all Loading... |
| 48 // storage object. | 50 // storage object. |
| 49 - (void)setAttributedString:(NSAttributedString*)aString; | 51 - (void)setAttributedString:(NSAttributedString*)aString; |
| 50 | 52 |
| 51 @end | 53 @end |
| 52 | 54 |
| 53 @interface AutocompleteTextFieldEditor(PrivateTestMethods) | 55 @interface AutocompleteTextFieldEditor(PrivateTestMethods) |
| 54 - (AutocompleteTextFieldObserver*)observer; | 56 - (AutocompleteTextFieldObserver*)observer; |
| 55 - (void)pasteAndGo:sender; | 57 - (void)pasteAndGo:sender; |
| 56 - (void)showURL:sender; | 58 - (void)showURL:sender; |
| 57 @end | 59 @end |
| OLD | NEW |