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

Unified Diff: chrome/browser/extensions/api/settings_private/settings_private_event_router.h

Issue 1163593005: Update chrome.settingsPrivate to support CrOS-only settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues preventing compilation on non-CrOS builds. Created 5 years, 6 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/extensions/api/settings_private/settings_private_event_router.h
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_event_router.h b/chrome/browser/extensions/api/settings_private/settings_private_event_router.h
index db8ea9c9ec922e67b174dcce87580bfb009db261..5b07a60020b9f5d35aa2b2cc1ecd87c8d5ff0cfa 100644
--- a/chrome/browser/extensions/api/settings_private/settings_private_event_router.h
+++ b/chrome/browser/extensions/api/settings_private/settings_private_event_router.h
@@ -6,6 +6,8 @@
#define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT_ROUTER_H_
#include "base/prefs/pref_change_registrar.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
+#include "chrome/browser/extensions/api/settings_private/prefs_util.h"
#include "components/keyed_service/core/keyed_service.h"
#include "extensions/browser/event_router.h"
@@ -28,7 +30,6 @@ class SettingsPrivateEventRouter : public KeyedService,
~SettingsPrivateEventRouter() override;
protected:
- SettingsPrivateEventRouter() {}
explicit SettingsPrivateEventRouter(content::BrowserContext* context);
// KeyedService overrides:
@@ -51,13 +52,20 @@ class SettingsPrivateEventRouter : public KeyedService,
// Otherwise, we want to unregister and not be listening for pref changes.
void StartOrStopListeningForPrefsChanges();
- void OnPreferenceChanged(PrefService* service, const std::string& pref_name);
+ void OnPreferenceChanged(const std::string& pref_name);
PrefChangeRegistrar* FindRegistrarForPref(const std::string& pref_name);
+ typedef std::map<std::string,
+ linked_ptr<chromeos::CrosSettings::ObserverSubscription>>
+ SubscriptionMap;
+ SubscriptionMap cros_settings_subscription_map_;
+
content::BrowserContext* context_;
bool listening_;
+ scoped_ptr<PrefsUtil> prefs_util_;
+
DISALLOW_COPY_AND_ASSIGN(SettingsPrivateEventRouter);
};

Powered by Google App Engine
This is Rietveld 408576698