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

Unified Diff: chrome/browser/managed_mode/managed_mode_navigation_observer.cc

Issue 12033021: Add UMA metrics and histograms for locally managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
Index: chrome/browser/managed_mode/managed_mode_navigation_observer.cc
===================================================================
--- chrome/browser/managed_mode/managed_mode_navigation_observer.cc (revision 177135)
+++ chrome/browser/managed_mode/managed_mode_navigation_observer.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/i18n/rtl.h"
+#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/api/infobars/infobar_service.h"
@@ -27,6 +28,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/frame_navigate_params.h"
#include "grit/generated_resources.h"
@@ -34,9 +36,17 @@
#include "ui/base/l10n/l10n_util.h"
using content::BrowserThread;
+using content::UserMetricsAction;
namespace {
+// For use in histograms.
+enum PreviewInfobarCommand {
+ INFOBAR_ACCEPT,
+ INFOBAR_CANCEL,
+ INFOBAR_HISTOGRAM_BOUNDING_VALUE
+};
+
class ManagedModeWarningInfobarDelegate : public ConfirmInfoBarDelegate {
public:
// Creates a managed mode warning delegate and adds it to |infobar_service|.
@@ -199,11 +209,17 @@
ManagedModeNavigationObserver* observer =
ManagedModeNavigationObserver::FromWebContents(
owner()->GetWebContents());
+ UMA_HISTOGRAM_ENUMERATION("ManagedMode.PreviewInfobarCommand",
+ INFOBAR_ACCEPT,
+ INFOBAR_HISTOGRAM_BOUNDING_VALUE);
observer->AddSavedURLsToWhitelistAndClearState();
return true;
}
bool ManagedModePreviewInfobarDelegate::Cancel() {
+ UMA_HISTOGRAM_ENUMERATION("ManagedMode.PreviewInfobarCommand",
+ INFOBAR_CANCEL,
+ INFOBAR_HISTOGRAM_BOUNDING_VALUE);
GoBackToSafety(owner()->GetWebContents());
return false;
}
@@ -351,9 +367,15 @@
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
+ content::RecordAction(UserMetricsAction("ManagedMode_MainFrameNavigation"));
+
ManagedModeURLFilter::FilteringBehavior behavior =
url_filter_->GetFilteringBehaviorForURL(params.url);
+ UMA_HISTOGRAM_ENUMERATION("ManagedMode.FilteringBehavior",
+ behavior,
+ ManagedModeURLFilter::HISTOGRAM_BOUNDING_VALUE);
+
// If the user just saw an interstitial this is the final URL so it is
// recorded. Checking for filtering behavior here isn't useful because
// although this specific URL can be allowed the hostname will be added which
« no previous file with comments | « chrome/browser/managed_mode/managed_mode_interstitial.cc ('k') | chrome/browser/managed_mode/managed_mode_url_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698