summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 04:36:09 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 04:36:09 +0000
commitac875371b19514403ddf6eaf10fb80e7d94ea6a2 (patch)
tree2d8094e4e07773742feb8847a89cf5498f20fc5b /chrome/browser/extensions
parent1709d6612cd714a7237a687cad3f4b7bc305c965 (diff)
downloadchromium_src-ac875371b19514403ddf6eaf10fb80e7d94ea6a2.zip
chromium_src-ac875371b19514403ddf6eaf10fb80e7d94ea6a2.tar.gz
chromium_src-ac875371b19514403ddf6eaf10fb80e7d94ea6a2.tar.bz2
Add UMA for extension blacklisting.
R=mpcomplete@chromium.org BUG=178122 Review URL: https://chromiumcodereview.appspot.com/12386003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/crx_installer.cc3
-rw-r--r--chrome/browser/extensions/extension_service.cc12
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 489b344..6179662 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -42,6 +42,7 @@
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/feature_switch.h"
+#include "chrome/common/extensions/manifest.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/resource_dispatcher_host.h"
@@ -658,6 +659,8 @@ void CrxInstaller::HandleIsBlacklistedResponse(
extensions::CrxInstallerError(error));
// Show error via reporter to make tests happy.
ExtensionErrorReporter::GetInstance()->ReportError(error, false); // quiet
+ UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlockCRX",
+ extension_->location(), Manifest::NUM_LOCATIONS);
} else {
on_success.Run();
}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index a64dfab..c333ae1 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -86,6 +86,7 @@
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/extensions/feature_switch.h"
#include "chrome/common/extensions/features/feature.h"
+#include "chrome/common/extensions/manifest.h"
#include "chrome/common/extensions/manifest_url_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/startup_metric_utils.h"
@@ -2081,10 +2082,9 @@ void ExtensionService::AddExtension(const Extension* extension) {
MaybeWipeout(extension);
if (extension_prefs_->IsExtensionBlacklisted(extension->id())) {
- // Don't check the Blacklist yet because it's asynchronous (we do it at
- // the end). This pre-emptive check is because we will always store the
- // blacklisted state of *installed* extensions in prefs, and it's important
- // not to re-enable blacklisted extensions.
+ // Only prefs is checked for the blacklist. We rely on callers to check the
+ // blacklist before calling into here, e.g. CrxInstaller checks before
+ // installation, we check when loading installed extensions.
blacklisted_extensions_.Insert(extension);
} else if (extension_prefs_->IsExtensionDisabled(extension->id())) {
disabled_extensions_.Insert(extension);
@@ -3112,6 +3112,8 @@ void ExtensionService::ManageBlacklist(
continue;
blacklisted_extensions_.Remove(*it);
AddExtension(extension);
+ UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.UnblacklistInstalled",
+ extension->location(), Manifest::NUM_LOCATIONS);
}
for (std::set<std::string>::iterator it = not_yet_blacklisted.begin();
@@ -3122,6 +3124,8 @@ void ExtensionService::ManageBlacklist(
continue;
blacklisted_extensions_.Insert(extension);
UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
+ UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled",
+ extension->location(), Manifest::NUM_LOCATIONS);
}
IdentifyAlertableExtensions();