summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field.mm5
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field_cell.h8
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm
index 49b0d80..a07cac1 100644
--- a/chrome/browser/cocoa/autocomplete_text_field.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field.mm
@@ -195,6 +195,7 @@
// Show the I-beam cursor unless the mouse is over an image within the field
// (Page Actions or the security icon) in which case show the arrow cursor.
+// TODO(rohitrao): Should default to the arrow cursor. http://crbug.com/41612
- (void)resetCursorRects {
NSRect fieldBounds = [self bounds];
[self addCursorRect:fieldBounds cursor:[NSCursor IBeamCursor]];
@@ -202,6 +203,10 @@
AutocompleteTextFieldCell* cell = [self autocompleteTextFieldCell];
for (AutocompleteTextFieldIcon* icon in [cell layedOutIcons:fieldBounds])
[self addCursorRect:[icon rect] cursor:[NSCursor arrowCursor]];
+
+ // Special-case the location image, since it is not in |-layedOutIcons|.
+ const NSRect locationIconFrame = [cell locationIconFrameForFrame:fieldBounds];
+ [self addCursorRect:locationIconFrame cursor:[NSCursor arrowCursor]];
}
// TODO(shess): -resetFieldEditorFrameIfNeeded is the place where
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.h b/chrome/browser/cocoa/autocomplete_text_field_cell.h
index 21963bc..bc791cf 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_cell.h
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell.h
@@ -107,6 +107,10 @@ class ExtensionAction;
- (void)setContentSettingViewsList:
(LocationBarViewMac::ContentSettingViews*)views;
+// Returns the portion of the cell to use for displaying the location
+// icon.
+- (NSRect)locationIconFrameForFrame:(NSRect)cellFrame;
+
// Returns an array of the visible AutocompleteTextFieldIcon objects. Returns
// only visible icons.
- (NSArray*)layedOutIcons:(NSRect)cellFrame;
@@ -161,8 +165,4 @@ class ExtensionAction;
// Returns the total number of installed Page Actions, visible or not.
- (size_t)pageActionCount;
-// Returns the portion of the cell to use for displaying the location
-// icon.
-- (NSRect)locationIconFrameForFrame:(NSRect)cellFrame;
-
@end