summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 19:00:55 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 19:00:55 +0000
commit345f8e4b5d9e1531e461cce3fd578372779c956a (patch)
tree69c46a93356a4ff180154fda0c050754231eafa1 /chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
parent8a9092a112ccbccd7c20c5c2f40e5e085c59febf (diff)
downloadchromium_src-345f8e4b5d9e1531e461cce3fd578372779c956a.zip
chromium_src-345f8e4b5d9e1531e461cce3fd578372779c956a.tar.gz
chromium_src-345f8e4b5d9e1531e461cce3fd578372779c956a.tar.bz2
Omnibox M5 work, part 1: Security changes
* Remove yellow background * Move lock icon from right side to left side (only on Win) * Change iconography * Change scheme colors * Add label for "Untrusted website" * Remove tooltip on label This also simplifies the LocationBarView code on Windows now that LocationBarImageView is unnecessary, and reorders a few things to try and be in more consistent/physical order. BUG=27570 TEST=Visit various https sites and see that the security icon is on the left, the scheme is colored, and there is no yellow background. Review URL: http://codereview.chromium.org/1056002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_edit_view_mac.mm')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm45
1 files changed, 15 insertions, 30 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 1ebc1f7..55b6f3f 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -61,15 +61,6 @@ const NSColor* ColorWithRGBBytes(int rr, int gg, int bb) {
blue:static_cast<float>(bb)/255.0
alpha:1.0];
}
-const NSColor* SecureBackgroundColor() {
- return ColorWithRGBBytes(255, 245, 195); // Yellow
-}
-const NSColor* NormalBackgroundColor() {
- return [NSColor controlBackgroundColor];
-}
-const NSColor* InsecureBackgroundColor() {
- return [NSColor controlBackgroundColor];
-}
const NSColor* HostTextColor() {
return [NSColor blackColor];
@@ -77,11 +68,14 @@ const NSColor* HostTextColor() {
const NSColor* BaseTextColor() {
return [NSColor darkGrayColor];
}
+const NSColor* EVSecureSchemeColor() {
+ return ColorWithRGBBytes(0x07, 0x95, 0x00);
+}
const NSColor* SecureSchemeColor() {
- return ColorWithRGBBytes(0x00, 0x96, 0x14);
+ return ColorWithRGBBytes(0x00, 0x0e, 0x95);
}
-const NSColor* InsecureSchemeColor() {
- return ColorWithRGBBytes(0xc8, 0x00, 0x00);
+const NSColor* SecurityErrorSchemeColor() {
+ return ColorWithRGBBytes(0xa2, 0x00, 0x00);
}
// Store's the model and view state across tab switches.
@@ -410,32 +404,23 @@ void AutocompleteEditViewMac::SetText(const std::wstring& display_text) {
// TODO(shess): GTK has this as a member var, figure out why.
// [Could it be to not change if no change? If so, I'm guessing
// AppKit may already handle that.]
- const ToolbarModel::SecurityLevel scheme_security_level =
- toolbar_model_->GetSchemeSecurityLevel();
-
- if (scheme_security_level == ToolbarModel::SECURE) {
- [field_ setBackgroundColor:SecureBackgroundColor()];
- } else if (scheme_security_level == ToolbarModel::NORMAL) {
- [field_ setBackgroundColor:NormalBackgroundColor()];
- } else if (scheme_security_level == ToolbarModel::INSECURE) {
- [field_ setBackgroundColor:InsecureBackgroundColor()];
- } else {
- NOTREACHED() << "Unexpected scheme_security_level: "
- << scheme_security_level;
- }
+ const ToolbarModel::SecurityLevel security_level =
+ toolbar_model_->GetSecurityLevel();
// Emphasize the scheme for security UI display purposes (if necessary).
if (!model_->user_input_in_progress() && scheme.is_nonempty() &&
- (scheme_security_level != ToolbarModel::NORMAL)) {
+ (security_level != ToolbarModel::NONE)) {
NSColor* color;
- if (scheme_security_level == ToolbarModel::SECURE) {
- color = SecureSchemeColor();
- } else {
- color = InsecureSchemeColor();
+ if (security_level == ToolbarModel::EV_SECURE) {
+ color = EVSecureSchemeColor();
+ } else if (security_level == ToolbarModel::SECURITY_ERROR) {
+ color = SecurityErrorSchemeColor();
// Add a strikethrough through the scheme.
[as addAttribute:NSStrikethroughStyleAttributeName
value:[NSNumber numberWithInt:NSUnderlineStyleSingle]
range:ComponentToNSRange(scheme)];
+ } else {
+ color = SecureSchemeColor();
}
[as addAttribute:NSForegroundColorAttributeName value:color
range:ComponentToNSRange(scheme)];