diff options
author | pamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 22:01:07 +0000 |
---|---|---|
committer | pamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 22:01:07 +0000 |
commit | 405dfb4047a28defa718f5d2d6e7fa16497f927b (patch) | |
tree | 934bbf26555028ca667d873eb30a1501d7356594 /chrome/browser/cocoa/autocomplete_text_field_cell.h | |
parent | d05aa247ac300beabb8b13bc5fab88b549a1af54 (diff) | |
download | chromium_src-405dfb4047a28defa718f5d2d6e7fa16497f927b.zip chromium_src-405dfb4047a28defa718f5d2d6e7fa16497f927b.tar.gz chromium_src-405dfb4047a28defa718f5d2d6e7fa16497f927b.tar.bz2 |
Refactor security-icon code to a more general form, also more consistent with
the Windows implementation, in preparation for implementing page actions.
BUG=14899, 22922, 12281
TEST=unit tests included
Review URL: http://codereview.chromium.org/264037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/autocomplete_text_field_cell.h')
-rw-r--r-- | chrome/browser/cocoa/autocomplete_text_field_cell.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.h b/chrome/browser/cocoa/autocomplete_text_field_cell.h index e158e4a..2aa04a8 100644 --- a/chrome/browser/cocoa/autocomplete_text_field_cell.h +++ b/chrome/browser/cocoa/autocomplete_text_field_cell.h @@ -5,6 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/scoped_nsobject.h" +#include "chrome/browser/cocoa/location_bar_view_mac.h" // AutocompleteTextFieldCell customizes the look of the Omnibox text // field. The border and focus ring are modified, as is the font @@ -26,13 +27,10 @@ // side of the field. Exclusive WRT |keywordString_|; scoped_nsobject<NSAttributedString> hintString_; - // Icon that represents the state of the SSL connection - scoped_nsobject<NSImage> hintIcon_; - - // Optional text that appears to the right of the hint icon which - // appears only alongside the icon (i.e., it's possible to display a - // hintIcon without an hintIconLabel, but not vice-versa). - scoped_nsobject<NSAttributedString> hintIconLabel_; + // View showing the state of the SSL connection. Owned by the location bar. + // Display is exclusive WRT the |hintString_| and |keywordString_|. + // This may be NULL during testing. + LocationBarViewMac::SecurityImageView* security_image_view_; } // Chooses |partialString| if |width| won't fit |fullString|. Strings @@ -54,9 +52,11 @@ availableWidth:(CGFloat)width; - (void)clearKeywordAndHint; -// Sets the hint icon and optional icon label. If |icon| is nil, the current -// icon is cleared. If |label| is provided, |color| must be provided as well. -- (void)setHintIcon:(NSImage*)icon label:(NSString*)label color:(NSColor*)color; +- (void)setSecurityImageView:(LocationBarViewMac::SecurityImageView*)view; + +// Called when the security icon is visible and clicked. Passed through to the +// security_image_view_ to handle the click (i.e., show the page info dialog). +- (void)onSecurityIconMousePressed; // Return the portion of the cell to show the text cursor over. - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame; @@ -65,8 +65,9 @@ // corresponds to the frame with our added decorations sliced off. - (NSRect)textFrameForFrame:(NSRect)cellFrame; -// Return the portion of the cell to use for displaing the |hintIcon_|. -- (NSRect)hintImageFrameForFrame:(NSRect)cellFrame; +// Return the portion of the cell to use for displaying the security (SSL lock) +// icon, leaving space for its label if any. +- (NSRect)securityImageFrameForFrame:(NSRect)cellFrame; @end @@ -75,7 +76,6 @@ @property(readonly) NSAttributedString* keywordString; @property(readonly) NSAttributedString* hintString; -@property(readonly) NSImage* hintIcon; @property(readonly) NSAttributedString* hintIconLabel; @end |