OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_SERVICE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/arc/arc_bridge_service.h" |
| 11 #include "components/arc/arc_service.h" |
| 12 |
| 13 namespace arc { |
| 14 |
| 15 class ArcSettingsServiceImpl; |
| 16 |
| 17 namespace fontsizes { |
| 18 |
| 19 // The following values were obtained from chrome://settings and Android's |
| 20 // Display settings on Nov 2015. They are expected to remain stable. |
| 21 const float kAndroidFontScaleSmall = 0.85; |
| 22 const float kAndroidFontScaleNormal = 1; |
| 23 const float kAndroidFontScaleLarge = 1.15; |
| 24 const float kAndroidFontScaleHuge = 1.3; |
| 25 const int kChromeFontSizeNormal = 16; |
| 26 const int kChromeFontSizeLarge = 20; |
| 27 const int kChromeFontSizeVeryLarge = 24; |
| 28 |
| 29 // Android has only a single float value for system-wide font size |
| 30 // (font_scale). Chrome has three main int pixel values that affect |
| 31 // system-wide font size. We will take the largest font value of the three |
| 32 // main font values on Chrome and convert to an Android size. |
| 33 double ConvertFontSizeChromeToAndroid(int default_size, |
| 34 int default_fixed_size, |
| 35 int minimum_size); |
| 36 |
| 37 } // namespace fontsizes |
| 38 |
| 39 class ArcSettingsService : public ArcService, |
| 40 public ArcBridgeService::Observer { |
| 41 public: |
| 42 explicit ArcSettingsService(ArcBridgeService* bridge_service); |
| 43 ~ArcSettingsService() override; |
| 44 |
| 45 // ArcBridgeService::Observer |
| 46 void OnIntentHelperInstanceReady() override; |
| 47 void OnIntentHelperInstanceClosed() override; |
| 48 |
| 49 private: |
| 50 scoped_ptr<ArcSettingsServiceImpl> impl_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ArcSettingsService); |
| 53 }; |
| 54 |
| 55 } // namespace arc |
| 56 |
| 57 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_SERVICE_H_ |
OLD | NEW |