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 #import "chrome/browser/cocoa/autocomplete_text_field.h" | 5 #import "chrome/browser/cocoa/autocomplete_text_field.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "chrome/browser/cocoa/autocomplete_text_field_cell.h" | 8 #import "chrome/browser/cocoa/autocomplete_text_field_cell.h" |
9 #import "chrome/browser/cocoa/browser_window_controller.h" | 9 #import "chrome/browser/cocoa/browser_window_controller.h" |
10 #import "chrome/browser/cocoa/toolbar_controller.h" | 10 #import "chrome/browser/cocoa/toolbar_controller.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // (Page Actions or the security icon) in which case show the arrow cursor. | 197 // (Page Actions or the security icon) in which case show the arrow cursor. |
198 - (void)resetCursorRects { | 198 - (void)resetCursorRects { |
199 NSRect fieldBounds = [self bounds]; | 199 NSRect fieldBounds = [self bounds]; |
200 [self addCursorRect:fieldBounds cursor:[NSCursor IBeamCursor]]; | 200 [self addCursorRect:fieldBounds cursor:[NSCursor IBeamCursor]]; |
201 | 201 |
202 AutocompleteTextFieldCell* cell = [self autocompleteTextFieldCell]; | 202 AutocompleteTextFieldCell* cell = [self autocompleteTextFieldCell]; |
203 for (AutocompleteTextFieldIcon* icon in [cell layedOutIcons:fieldBounds]) | 203 for (AutocompleteTextFieldIcon* icon in [cell layedOutIcons:fieldBounds]) |
204 [self addCursorRect:[icon rect] cursor:[NSCursor arrowCursor]]; | 204 [self addCursorRect:[icon rect] cursor:[NSCursor arrowCursor]]; |
205 } | 205 } |
206 | 206 |
| 207 // TODO(shess): -resetFieldEditorFrameIfNeeded is the place where |
| 208 // changes to the cell layout should be flushed. LocationBarViewMac |
| 209 // and ToolbarController are calling this routine directly, and I |
| 210 // think they are probably wrong. |
| 211 // http://crbug.com/40053 |
207 - (void)updateCursorAndToolTipRects { | 212 - (void)updateCursorAndToolTipRects { |
208 // This will force |resetCursorRects| to be called, as it is not to be called | 213 // This will force |resetCursorRects| to be called, as it is not to be called |
209 // directly. | 214 // directly. |
210 [[self window] invalidateCursorRectsForView:self]; | 215 [[self window] invalidateCursorRectsForView:self]; |
211 | 216 |
212 // |removeAllToolTips| only removes those set on the current NSView, not any | 217 // |removeAllToolTips| only removes those set on the current NSView, not any |
213 // subviews. Unless more tooltips are added to this view, this should suffice | 218 // subviews. Unless more tooltips are added to this view, this should suffice |
214 // in place of managing a set of NSToolTipTag objects. | 219 // in place of managing a set of NSToolTipTag objects. |
215 [self removeAllToolTips]; | 220 [self removeAllToolTips]; |
216 [currentToolTips_ removeAllObjects]; | 221 [currentToolTips_ removeAllObjects]; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // (URLDropTarget protocol) | 365 // (URLDropTarget protocol) |
361 - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender { | 366 - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender { |
362 return [dropHandler_ performDragOperation:sender]; | 367 return [dropHandler_ performDragOperation:sender]; |
363 } | 368 } |
364 | 369 |
365 - (NSMenu*)actionMenuForEvent:(NSEvent*)event { | 370 - (NSMenu*)actionMenuForEvent:(NSEvent*)event { |
366 return [[self autocompleteTextFieldCell] | 371 return [[self autocompleteTextFieldCell] |
367 actionMenuForEvent:event inRect:[self bounds] ofView:self]; | 372 actionMenuForEvent:event inRect:[self bounds] ofView:self]; |
368 } | 373 } |
369 | 374 |
| 375 - (NSRect)starIconFrame { |
| 376 AutocompleteTextFieldCell* cell = [self autocompleteTextFieldCell]; |
| 377 return [cell starIconFrameForFrame:[self bounds]]; |
| 378 } |
| 379 |
370 @end | 380 @end |
OLD | NEW |