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

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

Issue 216031: Add EV certificate text to the Mac location bar... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/location_bar_view_mac.mm
===================================================================
--- chrome/browser/cocoa/location_bar_view_mac.mm (revision 28476)
+++ chrome/browser/cocoa/location_bar_view_mac.mm (working copy)
@@ -43,6 +43,12 @@
return std::wstring();
}
+// Values for the green text color displayed for EV certificates, based
+// on the values for kEvTextColor in location_bar_view_gtk.cc.
+static const CGFloat kEvTextColorRedComponent = 0.0;
+static const CGFloat kEvTextColorGreenComponent = 0.59;
+static const CGFloat kEvTextColorBlueComponent = 0.08;
+
} // namespace
LocationBarViewMac::LocationBarViewMac(
@@ -267,17 +273,35 @@
}
void LocationBarViewMac::SetSecurityIcon(ToolbarModel::Icon security_icon) {
+ std::wstring info_text, info_tooltip;
+ ToolbarModel::InfoTextType info_text_type =
+ toolbar_model_->GetInfoText(&info_text, &info_tooltip);
+ NSColor* color = nil;
+ NSString* icon_label = nil;
+ if (info_text_type == ToolbarModel::INFO_EV_TEXT) {
+ icon_label = base::SysWideToNSString(info_text);
+ color =
+ [NSColor colorWithCalibratedRed:kEvTextColorRedComponent
+ green:kEvTextColorGreenComponent
+ blue:kEvTextColorBlueComponent
+ alpha:1.0];
+ }
+
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell];
switch (security_icon) {
case ToolbarModel::LOCK_ICON:
- [cell setHintIcon:rb.GetNSImageNamed(IDR_LOCK)];
+ [cell setHintIcon:rb.GetNSImageNamed(IDR_LOCK)
+ label:icon_label
+ color:color];
break;
case ToolbarModel::WARNING_ICON:
- [cell setHintIcon:rb.GetNSImageNamed(IDR_WARNING)];
+ [cell setHintIcon:rb.GetNSImageNamed(IDR_WARNING)
+ label:icon_label
+ color:color];
break;
case ToolbarModel::NO_ICON:
- [cell setHintIcon:nil];
+ [cell setHintIcon:nil label:nil color:nil];
break;
default:
NOTREACHED();
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698