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

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
« 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
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 8cf771a91536532251bbc5cf15636970793b1757..a4edbbd3e23dd5a5a82da9bcef746cb4e59ef4c8 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -67,6 +67,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";
@@ -600,6 +604,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);
@@ -610,6 +624,7 @@ void ExtensionPrefs::AcknowledgeExternalExtension(
DCHECK(Extension::IdIsValid(extension_id));
UpdateExtensionPref(extension_id, kPrefExternalAcknowledged,
Value::CreateBooleanValue(true));
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL);
}
bool ExtensionPrefs::IsBlacklistedExtensionAcknowledged(
@@ -622,6 +637,7 @@ void ExtensionPrefs::AcknowledgeBlacklistedExtension(
DCHECK(Extension::IdIsValid(extension_id));
UpdateExtensionPref(extension_id, kPrefBlacklistAcknowledged,
Value::CreateBooleanValue(true));
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL);
}
bool ExtensionPrefs::IsOrphanedExtensionAcknowledged(
@@ -634,6 +650,7 @@ void ExtensionPrefs::AcknowledgeOrphanedExtension(
DCHECK(Extension::IdIsValid(extension_id));
UpdateExtensionPref(extension_id, kPrefOrphanAcknowledged,
Value::CreateBooleanValue(true));
+ UpdateExtensionPref(extension_id, kPrefAcknowledgePromptCount, NULL);
}
bool ExtensionPrefs::SetAlertSystemFirstRun() {
« 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