Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 989 | 989 |
| 990 colors_[ThemeProperties::COLOR_TAB_THROBBER_SPINNING] = | 990 colors_[ThemeProperties::COLOR_TAB_THROBBER_SPINNING] = |
| 991 theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberSpinningColor); | 991 theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberSpinningColor); |
| 992 colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] = | 992 colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] = |
| 993 theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberWaitingColor); | 993 theme->GetSystemColor(ui::NativeTheme::kColorId_ThrobberWaitingColor); |
| 994 } | 994 } |
| 995 | 995 |
| 996 void Gtk2UI::UpdateMaterialDesignColors() { | 996 void Gtk2UI::UpdateMaterialDesignColors() { |
| 997 // TODO(varkha): This should be merged back into LoadGtkValues() once Material | 997 // TODO(varkha): This should be merged back into LoadGtkValues() once Material |
| 998 // Design is on unconditionally. | 998 // Design is on unconditionally. |
| 999 if (!ui::MaterialDesignController::is_mode_initialized()) | |
|
Evan Stade
2016/06/22 17:17:34
nit, I'd combine this with the below check. Also,
varkha
2016/06/22 17:23:31
Done.
| |
| 1000 return; | |
| 999 if (ui::MaterialDesignController::IsModeMaterial()) { | 1001 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 1000 NativeThemeGtk2* theme = NativeThemeGtk2::instance(); | 1002 NativeThemeGtk2* theme = NativeThemeGtk2::instance(); |
| 1001 SkColor label_color = | 1003 SkColor label_color = |
| 1002 theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor); | 1004 theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor); |
| 1003 colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] = | 1005 colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] = |
| 1004 color_utils::BlendTowardOppositeLuma(label_color, 50); | 1006 color_utils::BlendTowardOppositeLuma(label_color, 50); |
| 1005 } | 1007 } |
| 1006 } | 1008 } |
| 1007 | 1009 |
| 1008 SkColor Gtk2UI::BuildFrameColors() { | 1010 SkColor Gtk2UI::BuildFrameColors() { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1403 // Blacklist scaling factors <130% (crbug.com/484400) and round | 1405 // Blacklist scaling factors <130% (crbug.com/484400) and round |
| 1404 // to 1 decimal to prevent rendering problems (crbug.com/485183). | 1406 // to 1 decimal to prevent rendering problems (crbug.com/485183). |
| 1405 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; | 1407 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; |
| 1406 } | 1408 } |
| 1407 | 1409 |
| 1408 } // namespace libgtk2ui | 1410 } // namespace libgtk2ui |
| 1409 | 1411 |
| 1410 views::LinuxUI* BuildGtk2UI() { | 1412 views::LinuxUI* BuildGtk2UI() { |
| 1411 return new libgtk2ui::Gtk2UI; | 1413 return new libgtk2ui::Gtk2UI; |
| 1412 } | 1414 } |
| OLD | NEW |