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; |