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

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
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 app notifications setup or not.
+const char kPrefAppNotificationSetup[] = "app_notif_setup";
+
+// Indicates whether the user has disabled notifications or not.
+const char kPrefAppNotificationDisbaled[] = "app_notif_disabled";
+
// 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::IsAppNotificationSetupDone(
+ const std::string& extension_id) const {
+ return ReadExtensionPrefBoolean(
+ extension_id, kPrefAppNotificationSetup);
+}
+
+void ExtensionPrefs::SetAppNotificationSetupDone(
+ const std::string& extension_id,
+ bool value) {
+ DCHECK(Extension::IdIsValid(extension_id));
asargent_no_longer_on_chrome 2011/10/27 19:49:41 nit: UpdateExtensionPref already checks IdIsValid,
+ UpdateExtensionPref(extension_id, kPrefAppNotificationSetup,
+ Value::CreateBooleanValue(value));
+}
+
+bool ExtensionPrefs::IsAppNotificationDisabled(
+ const std::string& extension_id) const {
+ return ReadExtensionPrefBoolean(extension_id, kPrefAppNotificationDisbaled);
+}
+
+void ExtensionPrefs::SetAppNotificationDisabled(
+ const std::string& extension_id, bool value) {
+ DCHECK(Extension::IdIsValid(extension_id));
asargent_no_longer_on_chrome 2011/10/27 19:49:41 nit: UpdateExtensionPref already checks IdIsValid,
+ UpdateExtensionPref(extension_id, kPrefAppNotificationDisbaled,
+ Value::CreateBooleanValue(value));
+}
+
bool ExtensionPrefs::IsExtensionAllowedByPolicy(
const std::string& extension_id) {
std::string string_value;
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698