| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" | 10 #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 - (void)addLeftDecoration:(LocationBarDecoration*)decoration; | 58 - (void)addLeftDecoration:(LocationBarDecoration*)decoration; |
| 59 | 59 |
| 60 // Add a new right-side decoration to the left of the existing | 60 // Add a new right-side decoration to the left of the existing |
| 61 // right-side decorations. | 61 // right-side decorations. |
| 62 - (void)addRightDecoration:(LocationBarDecoration*)decoration; | 62 - (void)addRightDecoration:(LocationBarDecoration*)decoration; |
| 63 | 63 |
| 64 // The width available after accounting for decorations. | 64 // The width available after accounting for decorations. |
| 65 - (CGFloat)availableWidthInFrame:(const NSRect)frame; | 65 - (CGFloat)availableWidthInFrame:(const NSRect)frame; |
| 66 | 66 |
| 67 // Return the frame for |aDecoration| if the cell is in |cellFrame|. | 67 // Return the frame for |aDecoration| if the cell is in |cellFrame|. |
| 68 // Returns |NSZeroRect| for decorations which are not currently | 68 // Returns |NSZeroRect| for decorations which are not currently visible. |
| 69 // visible. | |
| 70 - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration | 69 - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration |
| 71 inFrame:(NSRect)cellFrame; | 70 inFrame:(NSRect)cellFrame; |
| 72 | 71 |
| 72 // Returns the frame representing the background of |decoration|. Also sets |
| 73 // |isLeftDecoration| according to whether the decoration appears on the left or |
| 74 // the right side of the text field. |
| 75 - (NSRect)backgroundFrameForDecoration:(LocationBarDecoration*)decoration |
| 76 inFrame:(NSRect)cellFrame |
| 77 isLeftDecoration:(BOOL*)isLeftDecoration; |
| 78 |
| 73 // Returns true if it's okay to drop dragged data into the view at the | 79 // Returns true if it's okay to drop dragged data into the view at the |
| 74 // given location. | 80 // given location. |
| 75 - (BOOL)canDropAtLocationInWindow:(NSPoint)location | 81 - (BOOL)canDropAtLocationInWindow:(NSPoint)location |
| 76 ofView:(AutocompleteTextField*)controlView; | 82 ofView:(AutocompleteTextField*)controlView; |
| 77 | 83 |
| 78 // Find the decoration under the location in the window. Return |NULL| if | 84 // Find the decoration under the location in the window. Return |NULL| if |
| 79 // there's nothing in the location. | 85 // there's nothing in the location. |
| 80 - (LocationBarDecoration*)decorationForLocationInWindow:(NSPoint)location | 86 - (LocationBarDecoration*)decorationForLocationInWindow:(NSPoint)location |
| 81 inRect:(NSRect)cellFrame | 87 inRect:(NSRect)cellFrame |
| 82 ofView:(AutocompleteTextField*) | 88 ofView:(AutocompleteTextField*) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ofView:(AutocompleteTextField*)controlView; | 135 ofView:(AutocompleteTextField*)controlView; |
| 130 @end | 136 @end |
| 131 | 137 |
| 132 // Methods which are either only for testing, or only public for testing. | 138 // Methods which are either only for testing, or only public for testing. |
| 133 @interface AutocompleteTextFieldCell (TestingAPI) | 139 @interface AutocompleteTextFieldCell (TestingAPI) |
| 134 | 140 |
| 135 // Returns |mouseTrackingDecorations_|. | 141 // Returns |mouseTrackingDecorations_|. |
| 136 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations; | 142 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations; |
| 137 | 143 |
| 138 @end | 144 @end |
| OLD | NEW |