OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/arc/intent_helper/font_size_util.h" |
| 6 |
| 7 #include <algorithm> |
| 8 |
| 9 namespace arc { |
| 10 |
| 11 double ConvertFontSizeChromeToAndroid(int default_size, |
| 12 int default_fixed_size, |
| 13 int minimum_size) { |
| 14 // kWebKitDefaultFixedFontSize is automatically set to be 3 pixels smaller |
| 15 // than kWebKitDefaultFontSize when Chrome's settings page's main font |
| 16 // dropdown control is adjusted. If the user specifically sets a higher |
| 17 // fixed font size we will want to take into account the adjustment. |
| 18 default_fixed_size += 3; |
| 19 int max_chrome_size = |
| 20 std::max(std::max(default_fixed_size, default_size), minimum_size); |
| 21 |
| 22 double android_scale = kAndroidFontScaleSmall; |
| 23 if (max_chrome_size >= kChromeFontSizeVeryLarge) { |
| 24 android_scale = kAndroidFontScaleHuge; |
| 25 } else if (max_chrome_size >= kChromeFontSizeLarge) { |
| 26 android_scale = kAndroidFontScaleLarge; |
| 27 } else if (max_chrome_size >= kChromeFontSizeNormal) { |
| 28 android_scale = kAndroidFontScaleNormal; |
| 29 } |
| 30 |
| 31 return android_scale; |
| 32 } |
| 33 |
| 34 } // namespace arc |
OLD | NEW |