Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: components/arc/intent_helper/font_size_util.cc

Issue 1843563003: Move arc_intent_helper_bridge.h from c/b/chromeos/ to components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address a comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « components/arc/intent_helper/font_size_util.h ('k') | components/arc/intent_helper/font_size_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698