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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 2401363005: Remove sundry IsModeMaterial checks. (Closed)
Patch Set: resolve merge conflict Created 4 years, 2 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/ui/libgtk2ui/gtk2_ui.h ('k') | chrome/browser/ui/tabs/tab_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6ab5f1f524ab38cb626bf0824e1ef45dda10bf16..1286923e796e11b01231d7c27ec33446cb8d04b1 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -40,7 +40,6 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkShader.h"
-#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/display/display.h"
#include "ui/gfx/canvas.h"
@@ -228,11 +227,6 @@ int indicators_count;
// The unknown content type.
const char* kUnknownContentType = "application/octet-stream";
-// Values used as the new luminance and saturation values in the inactive tab
-// text color.
-const double kInactiveLuminance = 0.15;
-const double kInactiveSaturation = 0.3;
-
// TODO(erg): ThemeService has a whole interface just for reading default
// constants. Figure out what to do with that more long term; for now, just
// copy the constants themselves here.
@@ -467,10 +461,6 @@ void Gtk2UI::Initialize() {
Gtk2EventLoop::GetInstance();
}
-void Gtk2UI::MaterialDesignControllerReady() {
- UpdateMaterialDesignColors();
-}
-
bool Gtk2UI::GetTint(int id, color_utils::HSL* tint) const {
switch (id) {
// Tints for which the cross-platform default is fine. Before adding new
@@ -825,6 +815,8 @@ void Gtk2UI::LoadGtkValues() {
colors_[ThemeProperties::COLOR_TAB_TEXT] = label_color;
colors_[ThemeProperties::COLOR_BOOKMARK_TEXT] = label_color;
+ colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] =
+ color_utils::BlendTowardOppositeLuma(label_color, 50);
UpdateDefaultFont();
@@ -833,21 +825,6 @@ void Gtk2UI::LoadGtkValues() {
GetNormalEntryForegroundHSL(&entry_tint_);
GetSelectedEntryForegroundHSL(&selected_entry_tint_);
- // The inactive frame color never occurs naturally in the theme, as it is a
- // tinted version of the normal 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
// as |toolbar_color|, is usually a white, and when it isn't a white,
@@ -927,23 +904,6 @@ void Gtk2UI::LoadCursorTheme() {
g_free(theme);
}
-void Gtk2UI::UpdateMaterialDesignColors() {
- // TODO(varkha): This should be merged back into LoadGtkValues() once Material
- // Design is on unconditionally.
- // Early return when Material Design Controller is not initialized yet. This
- // is harmless and the colors will get updated when this method is called
- // again after the initialization. See http://crbug.com/622234.
- if (!ui::MaterialDesignController::is_mode_initialized() ||
- !ui::MaterialDesignController::IsModeMaterial()) {
- return;
- }
- 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);
-}
-
void Gtk2UI::BuildFrameColors() {
#if GTK_MAJOR_VERSION == 2
NativeThemeGtk2* theme = NativeThemeGtk2::instance();
@@ -1111,9 +1071,6 @@ void Gtk2UI::UpdateDefaultFont() {
void Gtk2UI::ResetStyle() {
LoadGtkValues();
- // TODO(varkha): There will be no need to call UpdateMaterialDesignColors()
- // once Material Design is on unconditionally.
- UpdateMaterialDesignColors();
NativeThemeGtk2::instance()->NotifyObservers();
}
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.h ('k') | chrome/browser/ui/tabs/tab_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698