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

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

Issue 1610813003: Merge arc/common/settings.mojom into intent_helper.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back settings.mojom 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/settings_bridge.h
diff --git a/chrome/browser/chromeos/arc/arc_settings_bridge_impl.h b/chrome/browser/chromeos/arc/settings_bridge.h
similarity index 74%
rename from chrome/browser/chromeos/arc/arc_settings_bridge_impl.h
rename to chrome/browser/chromeos/arc/settings_bridge.h
index b26de1f836eee8b01c6255fb33df64c9f46e0310..0dce0029ccbf8f1252d815a31c7d554d3509d5ec 100644
--- a/chrome/browser/chromeos/arc/arc_settings_bridge_impl.h
+++ b/chrome/browser/chromeos/arc/settings_bridge.h
@@ -1,8 +1,8 @@
// 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_
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_SETTINGS_BRIDGE_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_SETTINGS_BRIDGE_H_
#include <string>
@@ -12,7 +12,6 @@
#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 {
@@ -40,27 +39,21 @@ double ConvertFontSizeChromeToAndroid(int default_size,
// 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 {
+class SettingsBridge : public chromeos::system::TimezoneSettings::Observer {
public:
- ArcSettingsBridgeImpl() = default;
+ class Delegate {
+ public:
+ virtual void OnBroadcastNeeded(const std::string& action,
+ const base::DictionaryValue& extras) = 0;
+ };
- ~ArcSettingsBridgeImpl() override;
-
- // Starts listening to state changes of the ArcBridgeService.
- // This must be called before the bridge service starts bootstrapping.
- void StartObservingBridgeServiceChanges() override;
+ explicit SettingsBridge(Delegate* delegate);
+ ~SettingsBridge() 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;
@@ -84,16 +77,18 @@ class ArcSettingsBridgeImpl
// 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.
+ // Sends a broadcast to the delegate.
void SendSettingsBroadcast(const std::string& action,
const base::DictionaryValue& extras) const;
// Manages pref observation registration.
PrefChangeRegistrar registrar_;
- DISALLOW_COPY_AND_ASSIGN(ArcSettingsBridgeImpl);
+ Delegate* delegate_;
Luis Héctor Chávez 2016/01/21 23:32:06 nit: Can you make this Delegate* const delegate_;?
Yusuke Sato 2016/01/22 00:57:57 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(SettingsBridge);
};
} // namespace arc
-#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SETTINGS_BRIDGE_IMPL_H_
+#endif // CHROME_BROWSER_CHROMEOS_ARC_SETTINGS_BRIDGE_H_
« no previous file with comments | « chrome/browser/chromeos/arc/arc_settings_bridge_unittest.cc ('k') | chrome/browser/chromeos/arc/settings_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698