summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 14:16:12 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 14:16:12 +0000
commitf474abdb177a3c870736e8c39f59f8a171af6c2a (patch)
treedbcac76fe41bc411190384421139e478b67471be
parentdbac96e9fb8dd39ecfa9d31825626447f9ea5f8b (diff)
downloadchromium_src-f474abdb177a3c870736e8c39f59f8a171af6c2a.zip
chromium_src-f474abdb177a3c870736e8c39f59f8a171af6c2a.tar.gz
chromium_src-f474abdb177a3c870736e8c39f59f8a171af6c2a.tar.bz2
[Mac] Add an arrow cursor rect for the location image.
BUG=41229 TEST=Mouse over the location image. Should show the arrow cursor, not an ibeam cursor. Review URL: http://codereview.chromium.org/1574028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44648 0039d316-1c4b-4281-b951-d872f2087c98
-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