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

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

Issue 11150002: New post-sideload UI: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 9f1762f0fecc057dacff9a43968b5918802f838a..a68c68970714d07ae7da253e3e36b756dc16ed00 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -64,6 +64,10 @@ const char kPrefAppNotificationClientId[] = "app_notif_client_id";
// Indicates whether the user has disabled notifications or not.
const char kPrefAppNotificationDisbaled[] = "app_notif_disabled";
+// The count of how many times we prompted the user to acknowledge an
+// extension.
+const char kPrefAcknowledgePromptCount[] = "ack_prompt_count";
+
// Indicates whether the user has acknowledged various types of extensions.
const char kPrefExternalAcknowledged[] = "ack_external";
const char kPrefBlacklistAcknowledged[] = "ack_blacklist";
@@ -597,6 +601,16 @@ bool ExtensionPrefs::IsExtensionOrphaned(const std::string& extension_id) {
return false;
}
+int ExtensionPrefs::IncrementAcknowledgePromptCount(
+ const std::string& extension_id) {
+ int count = 0;
+ ReadExtensionPrefInteger(extension_id, kPrefAcknowledgePromptCount, &count);
+ ++count;
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount,
+ Value::CreateIntegerValue(count));
+ return count;
+}
+
bool ExtensionPrefs::IsExternalExtensionAcknowledged(
const std::string& extension_id) {
return ReadExtensionPrefBoolean(extension_id, kPrefExternalAcknowledged);
@@ -607,6 +621,7 @@ void ExtensionPrefs::AcknowledgeExternalExtension(
DCHECK(Extension::IdIsValid(extension_id));
UpdateExtensionPref(extension_id, kPrefExternalAcknowledged,
Value::CreateBooleanValue(true));
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL);
}
bool ExtensionPrefs::IsBlacklistedExtensionAcknowledged(
@@ -619,6 +634,7 @@ void ExtensionPrefs::AcknowledgeBlacklistedExtension(
DCHECK(Extension::IdIsValid(extension_id));
UpdateExtensionPref(extension_id, kPrefBlacklistAcknowledged,
Value::CreateBooleanValue(true));
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL);
}
bool ExtensionPrefs::IsOrphanedExtensionAcknowledged(
@@ -631,6 +647,7 @@ void ExtensionPrefs::AcknowledgeOrphanedExtension(
DCHECK(Extension::IdIsValid(extension_id));
UpdateExtensionPref(extension_id, kPrefOrphanAcknowledged,
Value::CreateBooleanValue(true));
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL);
}
bool ExtensionPrefs::SetAlertSystemFirstRun() {

Powered by Google App Engine
This is Rietveld 408576698