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

Unified Diff: chrome/browser/content_settings/permission_infobar_delegate.cc

Issue 371933002: Add UMA for the new generic permisison class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rework the UMA based on mpearsons suggestion. Add extra UMA for ignored and dismissed requests Created 6 years, 5 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/content_settings/permission_infobar_delegate.cc
diff --git a/chrome/browser/content_settings/permission_infobar_delegate.cc b/chrome/browser/content_settings/permission_infobar_delegate.cc
index c2007076316d3a8bbec785ff1591aa9e5d607ec1..1ec2f6f3856390f113ecb73470fac8c1524e7da9 100644
--- a/chrome/browser/content_settings/permission_infobar_delegate.cc
+++ b/chrome/browser/content_settings/permission_infobar_delegate.cc
@@ -4,22 +4,29 @@
#include "chrome/browser/content_settings/permission_infobar_delegate.h"
+#include "chrome/browser/content_settings/permission_context_uma_util.h"
#include "chrome/browser/content_settings/permission_queue_controller.h"
#include "components/infobars/core/infobar.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
PermissionInfobarDelegate::~PermissionInfobarDelegate() {
+ if (!action_taken_)
+ PermissionContextUmaUtil::PermissionIgnored(type_);
}
PermissionInfobarDelegate::PermissionInfobarDelegate(
PermissionQueueController* controller,
const PermissionRequestID& id,
- const GURL& requesting_origin)
- : controller_(controller), id_(id), requesting_origin_(requesting_origin) {
+ const GURL& requesting_origin,
+ ContentSettingsType type)
+ : controller_(controller), id_(id), requesting_origin_(requesting_origin),
+ action_taken_(false),
+ type_(type) {
}
void PermissionInfobarDelegate::InfoBarDismissed() {
+ RegisterActionTaken();
SetPermission(false, false);
}
@@ -35,11 +42,13 @@ base::string16 PermissionInfobarDelegate::GetButtonLabel(
}
bool PermissionInfobarDelegate::Accept() {
+ RegisterActionTaken();
Bernhard Bauer 2014/07/14 15:22:15 You could probably move this into SetPermission().
Miguel Garcia 2014/07/14 16:57:50 I have actually removed the RegisterActionTaken ca
SetPermission(true, true);
return true;
}
bool PermissionInfobarDelegate::Cancel() {
+ RegisterActionTaken();
SetPermission(true, false);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698