| Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| index 12ee4bce2d7d9143609645d293dad4bcedcba29a..0b1923e4dbbd706de468f6199535dff975297751 100644
|
| --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
|
| @@ -516,10 +516,6 @@
|
| Gtk2EventLoop::GetInstance();
|
| }
|
|
|
| -void Gtk2UI::MaterialDesignControllerReady() {
|
| - UpdateMaterialDesignColors();
|
| -}
|
| -
|
| Gtk2UI::~Gtk2UI() {
|
| ClearAllThemeData();
|
| }
|
| @@ -905,20 +901,25 @@
|
| GetSelectedEntryForegroundHSL(&selected_entry_tint_);
|
| SkColor frame_color = BuildFrameColors();
|
|
|
| - // The inactive frame color never occurs naturally in the theme, as it is a
|
| - // tinted version of |frame_color|. We generate another color based on the
|
| - // background tab color, with the lightness and saturation moved in the
|
| - // opposite direction. (We don't touch the hue, since there should be subtle
|
| - // hints of the color in the text.)
|
| - color_utils::HSL inactive_tab_text_hsl;
|
| - color_utils::SkColorToHSL(
|
| - theme->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground),
|
| - &inactive_tab_text_hsl);
|
| - inactive_tab_text_hsl.s = kInactiveLuminance;
|
| - inactive_tab_text_hsl.l = kInactiveSaturation;
|
| -
|
| - colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] =
|
| - color_utils::HSLToSkColor(inactive_tab_text_hsl, 255);
|
| + if (ui::MaterialDesignController::IsModeMaterial()) {
|
| + colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] =
|
| + color_utils::BlendTowardOppositeLuma(label_color, 50);
|
| + } else {
|
| + // The inactive frame color never occurs naturally in the theme, as it is a
|
| + // tinted version of |frame_color|. We generate another color based on the
|
| + // background tab color, with the lightness and saturation moved in the
|
| + // opposite direction. (We don't touch the hue, since there should be subtle
|
| + // hints of the color in the text.)
|
| + color_utils::HSL inactive_tab_text_hsl;
|
| + color_utils::SkColorToHSL(
|
| + theme->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground),
|
| + &inactive_tab_text_hsl);
|
| + inactive_tab_text_hsl.s = kInactiveLuminance;
|
| + inactive_tab_text_hsl.l = kInactiveSaturation;
|
| +
|
| + colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] =
|
| + color_utils::HSLToSkColor(inactive_tab_text_hsl, 255);
|
| + }
|
|
|
| // 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
|
| @@ -977,18 +978,6 @@
|
| theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberSpinningColor);
|
| colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] =
|
| theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberWaitingColor);
|
| -}
|
| -
|
| -void Gtk2UI::UpdateMaterialDesignColors() {
|
| - // TODO(varkha): This should be merged back into LoadGtkValues() once Material
|
| - // Design is on unconditionally.
|
| - if (ui::MaterialDesignController::IsModeMaterial()) {
|
| - NativeThemeGtk2* theme = NativeThemeGtk2::instance();
|
| - SkColor label_color =
|
| - theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor);
|
| - colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] =
|
| - color_utils::BlendTowardOppositeLuma(label_color, 50);
|
| - }
|
| }
|
|
|
| SkColor Gtk2UI::BuildFrameColors() {
|
| @@ -1371,9 +1360,6 @@
|
| void Gtk2UI::ResetStyle() {
|
| ClearAllThemeData();
|
| LoadGtkValues();
|
| - // TODO(varkha): There will be no need to call UpdateMaterialDesignColors()
|
| - // once Material Design is on unconditionally.
|
| - UpdateMaterialDesignColors();
|
| NativeThemeGtk2::instance()->NotifyObservers();
|
| }
|
|
|
|
|