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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 8399022: Add a couple of notifications related settings to app/extensions sync: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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/extension_prefs.cc
===================================================================
--- chrome/browser/extensions/extension_prefs.cc (revision 107300)
+++ chrome/browser/extensions/extension_prefs.cc (working copy)
@@ -45,6 +45,12 @@
// Indicates whether an extension is blacklisted.
const char kPrefBlacklist[] = "blacklist";
+// Indicates whether the user has done intiial notifications setup or not.
+const char kPrefNotificationsInitialSetup[] = "notif_initial_setup";
asargent_no_longer_on_chrome 2011/10/27 16:52:21 Name change suggestions: kPrefNotificationsInitia
Munjal (Google) 2011/10/27 18:35:05 Done.
+
+// Indicates whether the user has disabled notifications or not.
+const char kPrefNotificationsDisbaled[] = "notif_disabled";
asargent_no_longer_on_chrome 2011/10/27 16:52:21 Name change suggestion: kPrefNotificationsDisbale
Munjal (Google) 2011/10/27 18:35:05 Done.
+
// Indicates whether the user has acknowledged various types of extensions.
const char kPrefExternalAcknowledged[] = "ack_external";
const char kPrefBlacklistAcknowledged[] = "ack_blacklist";
@@ -367,7 +373,7 @@
}
bool ExtensionPrefs::ReadExtensionPrefBoolean(
- const std::string& extension_id, const std::string& pref_key) {
+ const std::string& extension_id, const std::string& pref_key) const {
const DictionaryValue* ext = GetExtensionPref(extension_id);
if (!ext) {
// No such extension yet.
@@ -586,6 +592,32 @@
return false;
}
+bool ExtensionPrefs::IsNotificationsInitialSetupDone(
+ const std::string& extension_id) const {
+ return ReadExtensionPrefBoolean(
+ extension_id, kPrefNotificationsInitialSetup);
+}
+
+void ExtensionPrefs::SetNotificationsInitialSetupDone(
+ const std::string& extension_id,
+ bool value) {
+ DCHECK(Extension::IdIsValid(extension_id));
+ UpdateExtensionPref(extension_id, kPrefNotificationsInitialSetup,
+ Value::CreateBooleanValue(value));
+}
+
+bool ExtensionPrefs::IsNotificationsDisabled(
+ const std::string& extension_id) const {
+ return ReadExtensionPrefBoolean(extension_id, kPrefNotificationsDisbaled);
+}
+
+void ExtensionPrefs::SetNotificationsDisabled(
+ const std::string& extension_id, bool value) {
+ DCHECK(Extension::IdIsValid(extension_id));
+ UpdateExtensionPref(extension_id, kPrefNotificationsDisbaled,
+ Value::CreateBooleanValue(value));
+}
+
bool ExtensionPrefs::IsExtensionAllowedByPolicy(
const std::string& extension_id) {
std::string string_value;

Powered by Google App Engine
This is Rietveld 408576698