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

Unified Diff: chrome/browser/chromeos/cros_settings.h

Issue 8091002: PART2: Make SignedSettings use proper Value types instead of string all around the place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the nits and rebased on ToT (which now has PART1 in). Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros_settings.h
diff --git a/chrome/browser/chromeos/cros_settings.h b/chrome/browser/chromeos/cros_settings.h
index 563ee994f14b872ea655b44aeac4512734d2fd3d..c7f66d276ce0fcedd479f57912bee74fd6fb2d7e 100644
--- a/chrome/browser/chromeos/cros_settings.h
+++ b/chrome/browser/chromeos/cros_settings.h
@@ -35,8 +35,7 @@ class CrosSettings : public base::NonThreadSafe {
static bool IsCrosSettings(const std::string& path);
// Sets |in_value| to given |path| in cros settings.
- // Note that this takes ownership of |in_value|.
- void Set(const std::string& path, base::Value* in_value);
+ void Set(const std::string& path, const base::Value& in_value);
// Fires system setting change notification.
// TODO(pastarmovj): Consider to remove this function from the public
@@ -60,6 +59,10 @@ class CrosSettings : public base::NonThreadSafe {
void SetDouble(const std::string& path, double in_value);
void SetString(const std::string& path, const std::string& in_value);
+ // Convenience functions for manipulating lists.
+ void AppendToList(const std::string& path, const base::Value* value);
+ void RemoveFromList(const std::string& path, const base::Value* value);
+
// These are convenience forms of Get(). The value will be retrieved
// and the return value will be true if the path is valid and the value at
// the end of the path can be returned in the form specified.
@@ -70,6 +73,11 @@ class CrosSettings : public base::NonThreadSafe {
bool GetList(const std::string& path,
const base::ListValue** out_value) const;
+ // Helper function for the whitelist op. Implemented here because we will need
+ // this in a few places. The functions searches for |email| in the pref |path|
+ // It respects whitelists so foo@bar.baz will match *@bar.baz too.
+ bool FindEmailInList(const std::string& path, const std::string& email) const;
+
// adding/removing of providers
bool AddSettingsProvider(CrosSettingsProvider* provider);
bool RemoveSettingsProvider(CrosSettingsProvider* provider);
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698