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

Unified Diff: chrome/browser/gtk/gtk_theme_provider.cc

Issue 554004: GTK: Use GTK+ theme selection colors and plumb them into webkit. (Closed)
Patch Set: Move layout tests to correct paths Created 10 years, 11 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/gtk/gtk_theme_provider.h ('k') | chrome/browser/renderer_preferences_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/gtk_theme_provider.cc
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index 239308e9883d785853704f4f8b0b22fb22056908..404ca5691788e4eb23e63ccdad48f9b6c19438a7 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -552,15 +552,6 @@ void GtkThemeProvider::LoadGtkValues() {
SetTintToExactColor(BrowserThemeProvider::TINT_FRAME_INCOGNITO_INACTIVE,
&inactive_frame_color);
- focus_ring_color_ = GdkToSkColor(&button_color);
- GdkColor thumb_active_color, thumb_inactive_color, track_color;
- GtkThemeProvider::GetScrollbarColors(&thumb_active_color,
- &thumb_inactive_color,
- &track_color);
- thumb_active_color_ = GdkToSkColor(&thumb_active_color);
- thumb_inactive_color_ = GdkToSkColor(&thumb_inactive_color);
- track_color_ = GdkToSkColor(&track_color);
-
// We pick the text and background colors for the NTP out of the colors for a
// GtkEntry. We do this because GtkEntries background color is never the same
// as |toolbar_color|, is usually a white, and when it isn't a white,
@@ -601,6 +592,27 @@ void GtkThemeProvider::LoadGtkValues() {
link_color);
SetThemeColorFromGtk(BrowserThemeProvider::COLOR_NTP_SECTION_LINK_UNDERLINE,
link_color);
+
+ // Generate the colors that we pass to WebKit.
+ focus_ring_color_ = GdkToSkColor(&button_color);
+ GdkColor thumb_active_color, thumb_inactive_color, track_color;
+ GtkThemeProvider::GetScrollbarColors(&thumb_active_color,
+ &thumb_inactive_color,
+ &track_color);
+ thumb_active_color_ = GdkToSkColor(&thumb_active_color);
+ thumb_inactive_color_ = GdkToSkColor(&thumb_inactive_color);
+ track_color_ = GdkToSkColor(&track_color);
+
+ // Some GTK themes only define the text selection colors on the GtkEntry
+ // class, so we need to use that for getting selection colors.
+ active_selection_bg_color_ =
+ GdkToSkColor(&entry_style->base[GTK_STATE_SELECTED]);
+ active_selection_fg_color_ =
+ GdkToSkColor(&entry_style->text[GTK_STATE_SELECTED]);
+ inactive_selection_bg_color_ =
+ GdkToSkColor(&entry_style->base[GTK_STATE_ACTIVE]);
+ inactive_selection_fg_color_ =
+ GdkToSkColor(&entry_style->text[GTK_STATE_ACTIVE]);
}
void GtkThemeProvider::LoadDefaultValues() {
@@ -608,6 +620,11 @@ void GtkThemeProvider::LoadDefaultValues() {
thumb_active_color_ = SkColorSetRGB(250, 248, 245);
thumb_inactive_color_ = SkColorSetRGB(240, 235, 229);
track_color_ = SkColorSetRGB(227, 221, 216);
+
+ active_selection_bg_color_ = SkColorSetRGB(30, 144, 255);
+ active_selection_fg_color_ = SK_ColorBLACK;
+ inactive_selection_bg_color_ = SkColorSetRGB(200, 200, 200);
+ inactive_selection_fg_color_ = SkColorSetRGB(50, 50, 50);
}
void GtkThemeProvider::SetThemeColorFromGtk(int id, const GdkColor* color) {
« no previous file with comments | « chrome/browser/gtk/gtk_theme_provider.h ('k') | chrome/browser/renderer_preferences_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698