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

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

Issue 8202011: Notify users about certain changes in installed extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
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
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 53bb982d1fe8d032ac5927aee306d379b69da930..9917d3be60f5a4e2418a9b3837154ec23b3eb282 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -42,9 +42,14 @@ const char kPrefManifest[] = "manifest";
// The version number.
const char kPrefVersion[] = "manifest.version";
-// Indicates if an extension is blacklisted:
+// Indicates whether an extension is blacklisted.
const char kPrefBlacklist[] = "blacklist";
+// Indicates whether the user has acknowledged various types of extensions.
+const char kPrefExternalAcknowledged[] = "ack_external";
+const char kPrefBlacklistAcknowledged[] = "ack_blacklist";
+const char kPrefOrphanAcknowledged[] = "ack_orphan";
+
// Indicates whether to show an install warning when the user enables.
const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable";
@@ -524,6 +529,57 @@ bool ExtensionPrefs::IsExtensionBlacklisted(const std::string& extension_id) {
return ReadExtensionPrefBoolean(extension_id, kPrefBlacklist);
}
+bool ExtensionPrefs::IsExtensionOrphaned(const std::string& extension_id) {
+ // TODO(miket): we believe that this test will hinge on the number of
+ // consecutive times that an update check has returned a certain response
+ // versus a success response. For now nobody is orphaned.
+ return false;
+}
+
+bool ExtensionPrefs::IsExternalExtensionAcknowledged(
+ const std::string& extension_id) {
+ return ReadExtensionPrefBoolean(extension_id, kPrefExternalAcknowledged);
+}
+
+void ExtensionPrefs::AcknowledgeExternalExtension(
+ const std::string& extension_id) {
+ DCHECK(Extension::IdIsValid(extension_id));
+ UpdateExtensionPref(extension_id, kPrefExternalAcknowledged,
+ Value::CreateBooleanValue(true));
+}
+
+bool ExtensionPrefs::IsBlacklistedExtensionAcknowledged(
+ const std::string& extension_id) {
+ return ReadExtensionPrefBoolean(extension_id, kPrefBlacklistAcknowledged);
+}
+
+void ExtensionPrefs::AcknowledgeBlacklistedExtension(
+ const std::string& extension_id) {
+ DCHECK(Extension::IdIsValid(extension_id));
+ UpdateExtensionPref(extension_id, kPrefBlacklistAcknowledged,
+ Value::CreateBooleanValue(true));
+}
+
+bool ExtensionPrefs::IsOrphanedExtensionAcknowledged(
+ const std::string& extension_id) {
+ return ReadExtensionPrefBoolean(extension_id, kPrefOrphanAcknowledged);
+}
+
+void ExtensionPrefs::AcknowledgeOrphanedExtension(
+ const std::string& extension_id) {
+ DCHECK(Extension::IdIsValid(extension_id));
+ UpdateExtensionPref(extension_id, kPrefOrphanAcknowledged,
+ Value::CreateBooleanValue(true));
+}
+
+bool ExtensionPrefs::IsNotificationSystemInitialized() {
+ if (prefs_->GetBoolean(prefs::kExtensionNotificationsInitializedPref)) {
+ return true;
+ }
+ prefs_->SetBoolean(prefs::kExtensionNotificationsInitializedPref, true);
+ return false;
+}
+
bool ExtensionPrefs::IsExtensionAllowedByPolicy(
const std::string& extension_id) {
std::string string_value;

Powered by Google App Engine
This is Rietveld 408576698