summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 16:56:09 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 16:56:09 +0000
commit1b1d593920ad6078a0904762ce9500d06a8e63ed (patch)
tree4a61d4a063c3be305893e4400adfb0a5a663db13 /chrome/browser/autocomplete
parent27726561964a0cf94fa88fda87cf33cb0cfece54 (diff)
downloadchromium_src-1b1d593920ad6078a0904762ce9500d06a8e63ed.zip
chromium_src-1b1d593920ad6078a0904762ce9500d06a8e63ed.tar.gz
chromium_src-1b1d593920ad6078a0904762ce9500d06a8e63ed.tar.bz2
Force the foreground and background color of the omnibox text.
I didn't bother messing with the selection color or cursor color. BUG=11450 Review URL: http://codereview.chromium.org/115496 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index 4e6be71..725b0af 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -89,6 +89,9 @@ void AutocompleteEditViewGtk::Init() {
text_view_ = gtk_text_view_new_with_buffer(text_buffer_);
// Until we switch to vector graphics, force the font size.
gtk_util::ForceFontSizePixels(text_view_, 13.4); // 13.4px == 10pt @ 96dpi
+ // Override the background color for now. http://crbug.com/12195
+ gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL,
+ &LocationBarViewGtk::kBackgroundColorByLevel[scheme_security_level_]);
// The text view was floating. It will now be owned by the alignment.
gtk_container_add(GTK_CONTAINER(alignment_.get()), text_view_);
@@ -510,6 +513,11 @@ void AutocompleteEditViewGtk::EmphasizeURLComponents() {
AutocompleteInput::Parse(text, model_->GetDesiredTLD(), &parts, NULL);
bool emphasize = model_->CurrentTextIsURL() && (parts.host.len > 0);
+ // For now, force the text color to be black. Eventually, we should allow
+ // the user to override via gtk theming. http://crbug.com/12195
+ static GtkTextTag* black_text = gtk_text_buffer_create_tag(text_buffer_,
+ NULL, "foreground", "#000000", NULL);
+
// Set the baseline emphasis.
GtkTextIter start, end;
gtk_text_buffer_get_bounds(text_buffer_, &start, &end);
@@ -524,7 +532,12 @@ void AutocompleteEditViewGtk::EmphasizeURLComponents() {
gtk_text_buffer_get_iter_at_line_index(text_buffer_, &end, 0,
GetUTF8Offset(text,
parts.host.end()));
- gtk_text_buffer_remove_all_tags(text_buffer_, &start, &end);
+ // The following forces the text color to black. When we start obeying the
+ // user theme, we want to remove_all_tags (to get the user's default
+ // text color) rather than applying a color tag. http://crbug.com/12195
+ gtk_text_buffer_apply_tag(text_buffer_, black_text, &start, &end);
+ } else {
+ gtk_text_buffer_apply_tag(text_buffer_, black_text, &start, &end);
}
// Emphasize the scheme for security UI display purposes (if necessary).