diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 18:13:30 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 18:13:30 +0000 |
commit | 17c1461e33117455a3b0287fa95dbb5a5d1ab7d8 (patch) | |
tree | 9cd4c150e4c82064799f60a4d24a168cbcf23c9d /chrome/browser/autocomplete | |
parent | a9615bc5ec3f7e3f9cad650bc86d0375e936a614 (diff) | |
download | chromium_src-17c1461e33117455a3b0287fa95dbb5a5d1ab7d8.zip chromium_src-17c1461e33117455a3b0287fa95dbb5a5d1ab7d8.tar.gz chromium_src-17c1461e33117455a3b0287fa95dbb5a5d1ab7d8.tar.bz2 |
Improve the Linux Omnibox ssl background / scheme coloring.
We now correctly reset the background color on tab switches, and navigations from a ssl to non-ssl page.
BUG=8236,9225
Review URL: http://codereview.chromium.org/49015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index abd7a99..7a5464f 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -22,9 +22,13 @@ namespace { const char kTextBaseColor[] = "#808080"; const char kSecureSchemeColor[] = "#009614"; -const char kInsecureSchemeColor[] = "#009614"; -const GdkColor kSecureBackgroundColor = GDK_COLOR_RGB(0xff, 0xf5, 0xc3); -const GdkColor kInsecureBackgroundColor = GDK_COLOR_RGB(0xff, 0xff, 0xff); +const char kInsecureSchemeColor[] = "#c80000"; + +const GdkColor kBackgroundColorByLevel[] = { + GDK_COLOR_RGB(255, 245, 195), // SecurityLevel SECURE: Yellow. + GDK_COLOR_RGB(255, 255, 255), // SecurityLevel NORMAL: White. + GDK_COLOR_RGB(255, 255, 255), // SecurityLevel INSECURE: White. +}; } // namespace @@ -141,6 +145,14 @@ void AutocompleteEditViewGtk::Update(const TabContents* contents) { bool changed_security_level = (security_level != scheme_security_level_); scheme_security_level_ = security_level; + // TODO(deanm): This doesn't exactly match Windows. There there is a member + // background_color_. I think we can get away with just the level though. + if (changed_security_level) { + gtk_widget_modify_base(text_view_.get(), + GTK_STATE_NORMAL, + &kBackgroundColorByLevel[security_level]); + } + if (contents) { RevertAll(); // TODO(deanm): Tab switching. The Windows code puts some state in a @@ -148,7 +160,7 @@ void AutocompleteEditViewGtk::Update(const TabContents* contents) { } else if (visibly_changed_permanent_text) { RevertAll(); // TODO(deanm): There should be code to restore select all here. - } else if(changed_security_level) { + } else if (changed_security_level) { EmphasizeURLComponents(); } } @@ -518,17 +530,13 @@ void AutocompleteEditViewGtk::EmphasizeURLComponents() { parts.scheme.begin); gtk_text_buffer_get_iter_at_line_index(text_buffer_, &end, 0, parts.scheme.end()); - const GdkColor* background; if (scheme_security_level_ == ToolbarModel::SECURE) { - background = &kSecureBackgroundColor; gtk_text_buffer_apply_tag(text_buffer_, secure_scheme_tag_, &start, &end); } else { - background = &kInsecureBackgroundColor; gtk_text_buffer_apply_tag(text_buffer_, insecure_scheme_tag_, &start, &end); } - gtk_widget_modify_base(text_view_.get(), GTK_STATE_NORMAL, background); } } |