| 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 "ui/base/resource/resource_bundle.h" | 5 #include "ui/base/resource/resource_bundle.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 return *large_bold_font_list_; | 508 return *large_bold_font_list_; |
| 509 default: | 509 default: |
| 510 return *base_font_list_; | 510 return *base_font_list_; |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 | 513 |
| 514 const gfx::Font& ResourceBundle::GetFont(FontStyle style) { | 514 const gfx::Font& ResourceBundle::GetFont(FontStyle style) { |
| 515 return GetFontList(style).GetPrimaryFont(); | 515 return GetFontList(style).GetPrimaryFont(); |
| 516 } | 516 } |
| 517 | 517 |
| 518 // static |
| 519 ResourceBundle::FontStyle ResourceBundle::BoldOnlyIfItLooksGood() { |
| 520 #if defined(USE_AURA) && defined(OS_LINUX) |
| 521 return BaseFont; |
| 522 #else |
| 523 return BoldFont; |
| 524 #endif // defined(USE_AURA) && defined(OS_LINUX) |
| 525 } |
| 526 |
| 518 void ResourceBundle::ReloadFonts() { | 527 void ResourceBundle::ReloadFonts() { |
| 519 base::AutoLock lock_scope(*images_and_fonts_lock_); | 528 base::AutoLock lock_scope(*images_and_fonts_lock_); |
| 520 base_font_list_.reset(); | 529 base_font_list_.reset(); |
| 521 LoadFontsIfNecessary(); | 530 LoadFontsIfNecessary(); |
| 522 } | 531 } |
| 523 | 532 |
| 524 ScaleFactor ResourceBundle::GetMaxScaleFactor() const { | 533 ScaleFactor ResourceBundle::GetMaxScaleFactor() const { |
| 525 #if defined(OS_CHROMEOS) | 534 #if defined(OS_CHROMEOS) |
| 526 return max_scale_factor_; | 535 return max_scale_factor_; |
| 527 #else | 536 #else |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 // static | 807 // static |
| 799 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 808 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
| 800 size_t size, | 809 size_t size, |
| 801 SkBitmap* bitmap, | 810 SkBitmap* bitmap, |
| 802 bool* fell_back_to_1x) { | 811 bool* fell_back_to_1x) { |
| 803 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 812 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
| 804 return gfx::PNGCodec::Decode(buf, size, bitmap); | 813 return gfx::PNGCodec::Decode(buf, size, bitmap); |
| 805 } | 814 } |
| 806 | 815 |
| 807 } // namespace ui | 816 } // namespace ui |
| OLD | NEW |