summaryrefslogtreecommitdiffstats
path: root/chrome/browser/enumerate_modules_model_win.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:16:55 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 18:16:55 +0000
commitcfa433644357427096b13615975b2e6ef64949ed (patch)
tree4680ae60e9dd82103ece432212e32d311aceeb8f /chrome/browser/enumerate_modules_model_win.cc
parentcbf0e0a28293cc157031297957687c5f438c722f (diff)
downloadchromium_src-cfa433644357427096b13615975b2e6ef64949ed.zip
chromium_src-cfa433644357427096b13615975b2e6ef64949ed.tar.gz
chromium_src-cfa433644357427096b13615975b2e6ef64949ed.tar.bz2
Make sure we don't trigger the incompatibility badge if the flag is turned off when the user navigates to about:conflicts and finds a conflict.
Also, record an event when we show the incompatibilities badge to the user so we can find out how often this occurs in the field. BUG=None TEST=None Review URL: http://codereview.chromium.org/6061011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/enumerate_modules_model_win.cc')
-rw-r--r--chrome/browser/enumerate_modules_model_win.cc31
1 files changed, 20 insertions, 11 deletions
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc
index ead91ea..f7f7f99 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -842,19 +842,28 @@ void EnumerateModulesModel::DoneScanning() {
HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules",
confirmed_bad_modules_detected_);
- if (!limited_mode_) {
+ // Notifications are not available in limited mode.
+ if (limited_mode_)
+ return;
+
+ NotificationService::current()->Notify(
+ NotificationType::MODULE_LIST_ENUMERATED,
+ Source<EnumerateModulesModel>(this),
+ NotificationService::NoDetails());
+
+ // Command line flag must be enabled for the notification to get sent out.
+ // Otherwise we'd get the badge (while the feature is disabled) when we
+ // navigate to about:conflicts and find confirmed matches.
+ const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+ if (!cmd_line.HasSwitch(switches::kConflictingModulesCheck))
+ return;
+
+ if (suspected_bad_modules_detected_ || confirmed_bad_modules_detected_) {
+ bool found_confirmed_bad_modules = confirmed_bad_modules_detected_ > 0;
NotificationService::current()->Notify(
- NotificationType::MODULE_LIST_ENUMERATED,
+ NotificationType::MODULE_INCOMPATIBILITY_DETECTED,
Source<EnumerateModulesModel>(this),
- NotificationService::NoDetails());
-
- if (suspected_bad_modules_detected_ || confirmed_bad_modules_detected_) {
- bool found_confirmed_bad_modules = confirmed_bad_modules_detected_ > 0;
- NotificationService::current()->Notify(
- NotificationType::MODULE_INCOMPATIBILITY_DETECTED,
- Source<EnumerateModulesModel>(this),
- Details<bool>(&found_confirmed_bad_modules));
- }
+ Details<bool>(&found_confirmed_bad_modules));
}
}