| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 // TODO(erg): ThemeService has a whole interface just for reading default | 306 // TODO(erg): ThemeService has a whole interface just for reading default |
| 307 // constants. Figure out what to do with that more long term; for now, just | 307 // constants. Figure out what to do with that more long term; for now, just |
| 308 // copy the constants themselves here. | 308 // copy the constants themselves here. |
| 309 // | 309 // |
| 310 // Default tints. | 310 // Default tints. |
| 311 const color_utils::HSL kDefaultTintFrameIncognito = { -1, 0.2f, 0.35f }; | 311 const color_utils::HSL kDefaultTintFrameIncognito = { -1, 0.2f, 0.35f }; |
| 312 const color_utils::HSL kDefaultTintFrameIncognitoInactive = { -1, 0.3f, 0.6f }; | 312 const color_utils::HSL kDefaultTintFrameIncognitoInactive = { -1, 0.3f, 0.6f }; |
| 313 const color_utils::HSL kDefaultTintBackgroundTab = { -1, 0.5, 0.75 }; | 313 const color_utils::HSL kDefaultTintBackgroundTab = { -1, 0.5, 0.75 }; |
| 314 | 314 |
| 315 #if GTK_MAJOR_VERSION == 3 |
| 316 const color_utils::HSL kDefaultTintFrameInactive = { -1, -1, 0.75f }; |
| 317 #endif |
| 318 |
| 315 // Picks a button tint from a set of background colors. While | 319 // Picks a button tint from a set of background colors. While |
| 316 // |accent_color| will usually be the same color through a theme, this | 320 // |accent_color| will usually be the same color through a theme, this |
| 317 // function will get called with the normal GtkLabel |text_color|/GtkWindow | 321 // function will get called with the normal GtkLabel |text_color|/GtkWindow |
| 318 // |background_color| pair and the GtkEntry |text_color|/|background_color| | 322 // |background_color| pair and the GtkEntry |text_color|/|background_color| |
| 319 // pair. While 3/4 of the time the resulting tint will be the same, themes that | 323 // pair. While 3/4 of the time the resulting tint will be the same, themes that |
| 320 // have a dark window background (with light text) and a light text entry (with | 324 // have a dark window background (with light text) and a light text entry (with |
| 321 // dark text) will get better icons with this separated out. | 325 // dark text) will get better icons with this separated out. |
| 322 void PickButtonTintFromColors(SkColor accent_color, | 326 void PickButtonTintFromColors(SkColor accent_color, |
| 323 SkColor text_color, | 327 SkColor text_color, |
| 324 SkColor background_color, | 328 SkColor background_color, |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 // Blacklist scaling factors <130% (crbug.com/484400) and round | 1364 // Blacklist scaling factors <130% (crbug.com/484400) and round |
| 1361 // to 1 decimal to prevent rendering problems (crbug.com/485183). | 1365 // to 1 decimal to prevent rendering problems (crbug.com/485183). |
| 1362 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; | 1366 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; |
| 1363 } | 1367 } |
| 1364 | 1368 |
| 1365 } // namespace libgtk2ui | 1369 } // namespace libgtk2ui |
| 1366 | 1370 |
| 1367 views::LinuxUI* BuildGtk2UI() { | 1371 views::LinuxUI* BuildGtk2UI() { |
| 1368 return new libgtk2ui::Gtk2UI; | 1372 return new libgtk2ui::Gtk2UI; |
| 1369 } | 1373 } |
| OLD | NEW |