summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/autocomplete_text_field.mm
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 02:30:05 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 02:30:05 +0000
commit29193b9b0af28ed636ebad88d82f3e32466b3f76 (patch)
tree064e2e8ee3e001274f6f1975bedf3096b48e4b7f /chrome/browser/cocoa/autocomplete_text_field.mm
parent4b196999d76e86cf0f0b418cf260c2bfb41bc4de (diff)
downloadchromium_src-29193b9b0af28ed636ebad88d82f3e32466b3f76.zip
chromium_src-29193b9b0af28ed636ebad88d82f3e32466b3f76.tar.gz
chromium_src-29193b9b0af28ed636ebad88d82f3e32466b3f76.tar.bz2
[Mac] Show the page info window after clicking the security icon in the URL bar
BUG=22922 TEST=Go to https://twitter.com, click the lock icon, see page info window. Review URL: http://codereview.chromium.org/222020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28221 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/autocomplete_text_field.mm')
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm
index 1f2c23f4..60a7a56 100644
--- a/chrome/browser/cocoa/autocomplete_text_field.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field.mm
@@ -94,7 +94,8 @@
const NSPoint locationInWindow = [theEvent locationInWindow];
const NSPoint location = [self convertPoint:locationInWindow fromView:nil];
- const NSRect textFrame = [[self cell] textFrameForFrame:[self bounds]];
+ AutocompleteTextFieldCell* cell = [self cell];
+ const NSRect textFrame([cell textFrameForFrame:[self bounds]]);
// A version of the textFrame which extends across the field's
// entire width.
@@ -132,6 +133,14 @@
return;
}
+ // Check to see if the user clicked the hint icon in the cell. If so, we need
+ // to display the page info window.
+ const NSRect hintIconFrame = [cell hintImageFrameForFrame:[self bounds]];
+ if (NSMouseInRect(location, hintIconFrame, [self isFlipped])) {
+ observer_->OnSecurityIconClicked();
+ return;
+ }
+
NSText* editor = [self currentEditor];
// We should only be here if we accepted first-responder status and