Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1190)

Unified Diff: chrome/browser/cocoa/autocomplete_text_field.mm

Issue 222020: [Mac] Show the page info window after clicking the security icon in the URL bar (Closed)
Patch Set: Unit tests Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/autocomplete_text_field.mm
diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm
index 1f2c23f43cc58bbc90979809a5bf17fc57c79e76..60a7a56e5d2993e1f01febb2213461e9df094d7d 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

Powered by Google App Engine
This is Rietveld 408576698