summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-16 10:43:29 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-16 10:43:29 +0000
commit4157f0f012e78644ca4f69539aa3de6943e1740e (patch)
treececf94eb722bc592af1ecbf432e627b7fa18aa8e
parent5a8301519539cd438cc815fc707da7e3fc4eceb2 (diff)
downloadchromium_src-4157f0f012e78644ca4f69539aa3de6943e1740e.zip
chromium_src-4157f0f012e78644ca4f69539aa3de6943e1740e.tar.gz
chromium_src-4157f0f012e78644ca4f69539aa3de6943e1740e.tar.bz2
Merge 176875
> Fix overcounting of UMA stat for DisabledExtension.SideloadWipeoutNeeded. > > We only want to send this count once (when Wipeout has run). MaybeShow() is the wrong location for this, because it runs every time the Toolbar stack is created and wasn't early aborting correctly (should never check again if it has found that wipeout is active but didn't do anything). > > BUG=168620 > TEST=This can only be verified by looking at the UMA dashboard. > Review URL: https://codereview.chromium.org/11823054 TBR=finnur@chromium.org Review URL: https://codereview.chromium.org/11968013 git-svn-id: svn://svn.chromium.org/chrome/branches/1364/src@177128 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_service.cc4
-rw-r--r--chrome/browser/extensions/extension_service.h3
-rw-r--r--chrome/browser/ui/views/extensions/disabled_extensions_view.cc23
3 files changed, 18 insertions, 12 deletions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 035bea7..a68db57 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -361,6 +361,7 @@ ExtensionService::ExtensionService(Profile* profile,
browser_terminating_(false),
installs_delayed_(false),
wipeout_is_active_(false),
+ wipeout_count_(0u),
app_sync_bundle_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
extension_sync_bundle_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
app_shortcut_manager_(profile) {
@@ -618,6 +619,8 @@ void ExtensionService::Init() {
if (wipeout_is_active_) {
extension_prefs_->SetSideloadWipeoutDone();
wipeout_is_active_ = false; // Wipeout is only on during load.
+ UMA_HISTOGRAM_BOOLEAN("DisabledExtension.SideloadWipeoutNeeded",
+ wipeout_count_ > 0u);
}
if (extension_prefs_->NeedsStorageGarbageCollection()) {
@@ -2343,6 +2346,7 @@ void ExtensionService::MaybeWipeout(
static_cast<Extension::DisableReason>(
Extension::DISABLE_SIDELOAD_WIPEOUT));
UMA_HISTOGRAM_BOOLEAN("DisabledExtension.ExtensionWipedStatus", true);
+ wipeout_count_++;
}
}
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 98f0470..bc74594 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -971,6 +971,9 @@ class ExtensionService
// Whether any extension should be considered for wipeout.
bool wipeout_is_active_;
+ // How many extensions were wiped out.
+ size_t wipeout_count_;
+
NaClModuleInfoList nacl_module_list_;
extensions::AppSyncBundle app_sync_bundle_;
diff --git a/chrome/browser/ui/views/extensions/disabled_extensions_view.cc b/chrome/browser/ui/views/extensions/disabled_extensions_view.cc
index a218e23..02232ed 100644
--- a/chrome/browser/ui/views/extensions/disabled_extensions_view.cc
+++ b/chrome/browser/ui/views/extensions/disabled_extensions_view.cc
@@ -103,17 +103,18 @@ void DisabledExtensionsView::MaybeShow(Browser* browser,
if (!extensions::FeatureSwitch::sideload_wipeout()->IsEnabled())
return;
- static bool done_showing_ui = false;
- if (done_showing_ui)
+ static bool done_checking = false;
+ if (done_checking)
return; // Only show the bubble once per launch.
- // A pref that counts how often the bubble has been shown.
- IntegerPrefMember sideload_wipeout_bubble_shown;
- sideload_wipeout_bubble_shown.Init(
- prefs::kExtensionsSideloadWipeoutBubbleShown,
- browser->profile()->GetPrefs());
- if (sideload_wipeout_bubble_shown.GetValue() >= kShowSideloadWipeoutBubbleMax)
+ // A pref that counts how often the Sideload Wipeout bubble has been shown.
+ IntegerPrefMember bubble_shown;
+ bubble_shown.Init(prefs::kExtensionsSideloadWipeoutBubbleShown,
+ browser->profile()->GetPrefs());
+ if (bubble_shown.GetValue() >= kShowSideloadWipeoutBubbleMax) {
+ done_checking = true;
return;
+ }
// Fetch all disabled extensions.
ExtensionService* extension_service =
@@ -121,17 +122,15 @@ void DisabledExtensionsView::MaybeShow(Browser* browser,
browser->profile())->extension_service();
scoped_ptr<const ExtensionSet> wiped_out(
extension_service->GetWipedOutExtensions());
- UMA_HISTOGRAM_BOOLEAN("DisabledExtension.SideloadWipeoutNeeded",
- wiped_out->size() > 0);
if (wiped_out->size()) {
DisabledExtensionsView* bubble_delegate =
new DisabledExtensionsView(
anchor_view, browser, wiped_out.release());
views::BubbleDelegateView::CreateBubble(bubble_delegate);
bubble_delegate->ShowWhenReady();
-
- done_showing_ui = true;
}
+
+ done_checking = true;
}
void DisabledExtensionsView::ShowWhenReady() {