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

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

Issue 1287913005: Refactor prefs.js for MD-Settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add return after switch for non-clang Created 5 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/settings_private/prefs_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/settings_private/prefs_util.h
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.h b/chrome/browser/extensions/api/settings_private/prefs_util.h
index 0387459603505009fbaefaf1581e78d658c1c59b..e9e79096b23e162f24a96f8ebf520779d11f108b 100644
--- a/chrome/browser/extensions/api/settings_private/prefs_util.h
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.h
@@ -20,6 +20,15 @@ namespace extensions {
class PrefsUtil {
public:
+ // Success or error statuses from calling SetPref.
+ enum SetPrefResult {
+ SUCCESS,
+ PREF_NOT_MODIFIABLE,
+ PREF_NOT_FOUND,
+ PREF_TYPE_MISMATCH,
+ PREF_TYPE_UNSUPPORTED
+ };
+
using TypedPrefMap = std::map<std::string, api::settings_private::PrefType>;
explicit PrefsUtil(Profile* profile);
@@ -36,7 +45,8 @@ class PrefsUtil {
const std::string& name);
// Sets the pref with the given name and value in the proper PrefService.
- virtual bool SetPref(const std::string& name, const base::Value* value);
+ virtual SetPrefResult SetPref(const std::string& name,
+ const base::Value* value);
// Appends the given |value| to the list setting specified by the path in
// |pref_name|.
@@ -69,7 +79,8 @@ class PrefsUtil {
scoped_ptr<api::settings_private::PrefObject> GetCrosSettingsPref(
const std::string& name);
- bool SetCrosSettingsPref(const std::string& name, const base::Value* value);
+ SetPrefResult SetCrosSettingsPref(const std::string& name,
+ const base::Value* value);
Profile* profile_; // weak
};
« no previous file with comments | « no previous file | chrome/browser/extensions/api/settings_private/prefs_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698