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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 6061011: Make sure we don't trigger the incompatibility badge when the flag.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/enumerate_modules_model_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar_view.cc
===================================================================
--- chrome/browser/ui/views/toolbar_view.cc (revision 70726)
+++ chrome/browser/ui/views/toolbar_view.cc (working copy)
@@ -11,6 +11,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/accessibility/browser_accessibility_state.h"
#include "chrome/browser/background_page_tracker.h"
+#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/browser_theme_provider.h"
@@ -732,6 +733,15 @@
}
SkBitmap icon = *tp->GetBitmapNamed(id);
+#if defined(OS_WIN)
+ // Keep track of whether we were showing the badge before, so we don't send
+ // multiple UMA events for example when multiple Chrome windows are open.
+ static bool incompatibility_badge_showing = false;
+ // Save the old value before resetting it.
+ bool was_showing = incompatibility_badge_showing;
+ incompatibility_badge_showing = false;
+#endif
+
bool add_badge = IsUpgradeRecommended() ||
ShouldShowIncompatibilityWarning() ||
ShouldShowBackgroundPageBadge();
@@ -753,7 +763,10 @@
badge = *tp->GetBitmapNamed(IDR_BACKGROUND_BADGE);
} else if (ShouldShowIncompatibilityWarning()) {
#if defined(OS_WIN)
+ if (!was_showing)
+ UserMetrics::RecordAction(UserMetricsAction("ConflictBadge"), profile_);
badge = *tp->GetBitmapNamed(IDR_CONFLICT_BADGE);
+ incompatibility_badge_showing = true;
#else
NOTREACHED();
#endif
« no previous file with comments | « chrome/browser/enumerate_modules_model_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698