| 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 <limits> | 7 #include <limits> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/big_endian.h" | 10 #include "base/big_endian.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "ui/gfx/image/image_skia.h" | 34 #include "ui/gfx/image/image_skia.h" |
| 35 #include "ui/gfx/image/image_skia_source.h" | 35 #include "ui/gfx/image/image_skia_source.h" |
| 36 #include "ui/gfx/screen.h" | 36 #include "ui/gfx/screen.h" |
| 37 #include "ui/strings/grit/app_locale_settings.h" | 37 #include "ui/strings/grit/app_locale_settings.h" |
| 38 | 38 |
| 39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
| 40 #include "ui/base/resource/resource_bundle_android.h" | 40 #include "ui/base/resource/resource_bundle_android.h" |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
| 44 #include "ui/base/font_helper_chromeos.h" | |
| 45 #include "ui/gfx/platform_font_linux.h" | 44 #include "ui/gfx/platform_font_linux.h" |
| 46 #endif | 45 #endif |
| 47 | 46 |
| 48 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 49 #include "ui/gfx/win/dpi.h" | 48 #include "ui/gfx/win/dpi.h" |
| 50 #endif | 49 #endif |
| 51 | 50 |
| 52 #if defined(OS_MACOSX) && !defined(OS_IOS) | 51 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 53 #include "base/mac/mac_util.h" | 52 #include "base/mac/mac_util.h" |
| 54 #endif | 53 #endif |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 666 |
| 668 if (GetScaleForScaleFactor(data_pack->GetScaleFactor()) > | 667 if (GetScaleForScaleFactor(data_pack->GetScaleFactor()) > |
| 669 GetScaleForScaleFactor(max_scale_factor_)) | 668 GetScaleForScaleFactor(max_scale_factor_)) |
| 670 max_scale_factor_ = data_pack->GetScaleFactor(); | 669 max_scale_factor_ = data_pack->GetScaleFactor(); |
| 671 } | 670 } |
| 672 | 671 |
| 673 void ResourceBundle::InitDefaultFontList() { | 672 void ResourceBundle::InitDefaultFontList() { |
| 674 #if defined(OS_CHROMEOS) | 673 #if defined(OS_CHROMEOS) |
| 675 std::string font_family = base::UTF16ToUTF8( | 674 std::string font_family = base::UTF16ToUTF8( |
| 676 GetLocalizedString(IDS_UI_FONT_FAMILY_CROS)); | 675 GetLocalizedString(IDS_UI_FONT_FAMILY_CROS)); |
| 677 ui::ReplaceNotoSansWithRobotoIfEnabled(&font_family); | |
| 678 gfx::FontList::SetDefaultFontDescription(font_family); | 676 gfx::FontList::SetDefaultFontDescription(font_family); |
| 679 | 677 |
| 680 // TODO(yukishiino): Remove SetDefaultFontDescription() once the migration to | 678 // TODO(yukishiino): Remove SetDefaultFontDescription() once the migration to |
| 681 // the font list is done. We will no longer need SetDefaultFontDescription() | 679 // the font list is done. We will no longer need SetDefaultFontDescription() |
| 682 // after every client gets started using a FontList instead of a Font. | 680 // after every client gets started using a FontList instead of a Font. |
| 683 gfx::PlatformFontLinux::SetDefaultFontDescription(font_family); | 681 gfx::PlatformFontLinux::SetDefaultFontDescription(font_family); |
| 684 #else | 682 #else |
| 685 // Use a single default font as the default font list. | 683 // Use a single default font as the default font list. |
| 686 gfx::FontList::SetDefaultFontDescription(std::string()); | 684 gfx::FontList::SetDefaultFontDescription(std::string()); |
| 687 #endif | 685 #endif |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 // static | 854 // static |
| 857 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 855 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
| 858 size_t size, | 856 size_t size, |
| 859 SkBitmap* bitmap, | 857 SkBitmap* bitmap, |
| 860 bool* fell_back_to_1x) { | 858 bool* fell_back_to_1x) { |
| 861 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 859 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
| 862 return gfx::PNGCodec::Decode(buf, size, bitmap); | 860 return gfx::PNGCodec::Decode(buf, size, bitmap); |
| 863 } | 861 } |
| 864 | 862 |
| 865 } // namespace ui | 863 } // namespace ui |
| OLD | NEW |