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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 2089263002: [top-chrome-md] Allows UpdateMaterialDesignColors to be called before MDC::Initialize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/base/material_design/material_design_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/material_design/material_design_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698