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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 412003003: Additional metrics for disabled extensions and content verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged latest origin/master Created 6 years, 5 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 | « extensions/browser/extension_prefs.h ('k') | extensions/common/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index b50e71606f4ce587a1757ca313e1b6f5e9d1e544..efe3ba419ecf4e82d62b4b8ff5ac80204abbf91b 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -195,6 +195,8 @@ const char kInstallSignature[] = "extensions.install_signature";
// synced. Default value is false.
const char kPrefDoNotSync[] = "do_not_sync";
+const char kCorruptedDisableCount[] = "extensions.corrupted_disable_count";
+
// Provider of write access to a dictionary storing extension prefs.
class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate {
public:
@@ -1895,6 +1897,15 @@ void ExtensionPrefs::SetInstallParam(const std::string& extension_id,
new base::StringValue(install_parameter));
}
+int ExtensionPrefs::GetCorruptedDisableCount() {
+ return prefs_->GetInteger(kCorruptedDisableCount);
+}
+
+void ExtensionPrefs::IncrementCorruptedDisableCount() {
+ int count = prefs_->GetInteger(kCorruptedDisableCount);
+ prefs_->SetInteger(kCorruptedDisableCount, count + 1);
+}
+
ExtensionPrefs::ExtensionPrefs(
PrefService* prefs,
const base::FilePath& root_dir,
@@ -2002,6 +2013,10 @@ void ExtensionPrefs::RegisterProfilePrefs(
pref_names::kNativeMessagingUserLevelHosts,
true, // default value
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterIntegerPref(
+ kCorruptedDisableCount,
+ 0, // default value
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
template <class ExtensionIdContainer>
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | extensions/common/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698