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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 if (!bitmap.empty()) | 550 if (!bitmap.empty()) |
551 image = gfx::Image::CreateFrom1xBitmap(bitmap); | 551 image = gfx::Image::CreateFrom1xBitmap(bitmap); |
552 } | 552 } |
553 | 553 |
554 gtk_images_[id] = image; | 554 gtk_images_[id] = image; |
555 return image; | 555 return image; |
556 } | 556 } |
557 | 557 |
558 bool Gtk2UI::GetTint(int id, color_utils::HSL* tint) const { | 558 bool Gtk2UI::GetTint(int id, color_utils::HSL* tint) const { |
559 switch (id) { | 559 switch (id) { |
| 560 // Tints for which the cross-platform default is fine. Before adding new |
| 561 // values here, specifically verify they work well on Linux. |
560 case ThemeProperties::TINT_BACKGROUND_TAB: | 562 case ThemeProperties::TINT_BACKGROUND_TAB: |
561 // Tints for which the cross-platform default is fine. Before adding new | 563 // TODO(estade): Return something useful for TINT_BUTTONS so that chrome:// |
562 // values here, specifically verify they work well on Linux. | 564 // page icons are colored appropriately. |
| 565 case ThemeProperties::TINT_BUTTONS: |
563 break; | 566 break; |
564 default: | 567 default: |
565 // Assume any tints not specifically verified on Linux aren't usable. | 568 // Assume any tints not specifically verified on Linux aren't usable. |
566 // TODO(pkasting): Try to remove values from |colors_| that could just be | 569 // TODO(pkasting): Try to remove values from |colors_| that could just be |
567 // added to the group above instead. | 570 // added to the group above instead. |
568 NOTREACHED(); | 571 NOTREACHED(); |
569 } | 572 } |
570 return false; | 573 return false; |
571 } | 574 } |
572 | 575 |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 // Blacklist scaling factors <130% (crbug.com/484400) and round | 1411 // Blacklist scaling factors <130% (crbug.com/484400) and round |
1409 // to 1 decimal to prevent rendering problems (crbug.com/485183). | 1412 // to 1 decimal to prevent rendering problems (crbug.com/485183). |
1410 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; | 1413 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; |
1411 } | 1414 } |
1412 | 1415 |
1413 } // namespace libgtk2ui | 1416 } // namespace libgtk2ui |
1414 | 1417 |
1415 views::LinuxUI* BuildGtk2UI() { | 1418 views::LinuxUI* BuildGtk2UI() { |
1416 return new libgtk2ui::Gtk2UI; | 1419 return new libgtk2ui::Gtk2UI; |
1417 } | 1420 } |
OLD | NEW |