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

Unified Diff: chrome/browser/chromeos/arc/arc_settings_bridge_impl.h

Issue 1596663002: arc-bridge: Introduce the ArcService class (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Rebased + protected ArcService direct instantiation Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_settings_bridge_impl.h
diff --git a/chrome/browser/chromeos/arc/arc_settings_bridge_impl.h b/chrome/browser/chromeos/arc/arc_settings_bridge_impl.h
deleted file mode 100644
index b26de1f836eee8b01c6255fb33df64c9f46e0310..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/arc/arc_settings_bridge_impl.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_BRIDGE_IMPL_H_
-#define CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_BRIDGE_IMPL_H_
-
-#include <string>
-
-#include "base/gtest_prod_util.h"
-#include "base/macros.h"
-#include "base/prefs/pref_change_registrar.h"
-#include "base/values.h"
-#include "chromeos/settings/timezone_settings.h"
-#include "components/arc/arc_bridge_service.h"
-#include "components/arc/settings/arc_settings_bridge.h"
-
-namespace arc {
-
-namespace fontsizes {
-
-// The following values were obtained from chrome://settings and Android's
-// Display settings on Nov 2015. They are expected to remain stable.
-const float kAndroidFontScaleSmall = 0.85;
-const float kAndroidFontScaleNormal = 1;
-const float kAndroidFontScaleLarge = 1.15;
-const float kAndroidFontScaleHuge = 1.3;
-const int kChromeFontSizeNormal = 16;
-const int kChromeFontSizeLarge = 20;
-const int kChromeFontSizeVeryLarge = 24;
-
-// Android has only a single float value for system-wide font size
-// (font_scale). Chrome has three main int pixel values that affect
-// system-wide font size. We will take the largest font value of the three
-// main font values on Chrome and convert to an Android size.
-double ConvertFontSizeChromeToAndroid(int default_size,
- int default_fixed_size,
- int minimum_size);
-
-} // namespace fontsizes
-
-// Listens to changes for select Chrome settings (prefs) that Android cares
-// about and sends the new values to Android to keep the state in sync.
-class ArcSettingsBridgeImpl
- : public ArcSettingsBridge,
- public ArcBridgeService::Observer,
- public chromeos::system::TimezoneSettings::Observer {
- public:
- ArcSettingsBridgeImpl() = default;
-
- ~ArcSettingsBridgeImpl() override;
-
- // Starts listening to state changes of the ArcBridgeService.
- // This must be called before the bridge service starts bootstrapping.
- void StartObservingBridgeServiceChanges() override;
-
- // Called when a Chrome pref we have registered an observer for has changed.
- // Obtains the new pref value and sends it to Android.
- void OnPrefChanged(const std::string& pref_name) const;
-
- // ArcBridgeService::Observer
- void OnStateChanged(ArcBridgeService::State state) override;
- void OnSettingsInstanceReady() override;
-
- // TimezoneSettings::Observer
- void TimezoneChanged(const icu::TimeZone& timezone) override;
-
- private:
- // Registers to observe changes for Chrome settings we care about.
- void StartObservingSettingsChanges();
-
- // Stops listening for Chrome settings changes.
- void StopObservingSettingsChanges();
-
- // Retrives Chrome's state for the settings and send it to Android.
- void SyncAllPrefs() const;
- void SyncFontSize() const;
- void SyncLocale() const;
- void SyncSpokenFeedbackEnabled() const;
- void SyncTimeZone() const;
-
- // Registers to listen to a particular perf.
- void AddPrefToObserve(const std::string& pref_name);
-
- // Returns the integer value of the pref. pref_name must exist.
- int GetIntegerPref(const std::string& pref_name) const;
-
- // Sends a broadcast to the ArcSettings app in Android.
- void SendSettingsBroadcast(const std::string& action,
- const base::DictionaryValue& extras) const;
-
- // Manages pref observation registration.
- PrefChangeRegistrar registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(ArcSettingsBridgeImpl);
-};
-
-} // namespace arc
-
-#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_BRIDGE_IMPL_H_
« no previous file with comments | « chrome/browser/chromeos/arc/arc_settings_bridge.cc ('k') | chrome/browser/chromeos/arc/arc_settings_bridge_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698