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

Unified Diff: chrome/browser/ui/website_settings/mock_permission_bubble_request.cc

Issue 2017873002: Add metrics for permission prompt acceptance / denial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 7 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/ui/website_settings/mock_permission_bubble_request.cc
diff --git a/chrome/browser/ui/website_settings/mock_permission_bubble_request.cc b/chrome/browser/ui/website_settings/mock_permission_bubble_request.cc
index 06fbad6c907431abbad817b63b702acdfa224a0a..ce08e3cf97bb262e9821ee0e1d54b3c8d9120c5b 100644
--- a/chrome/browser/ui/website_settings/mock_permission_bubble_request.cc
+++ b/chrome/browser/ui/website_settings/mock_permission_bubble_request.cc
@@ -9,50 +9,46 @@
#include "grit/theme_resources.h"
MockPermissionBubbleRequest::MockPermissionBubbleRequest()
- : granted_(false),
- cancelled_(false),
- finished_(false) {
- text_ = base::ASCIIToUTF16("test");
- accept_label_ = base::ASCIIToUTF16("button");
- deny_label_ = base::ASCIIToUTF16("button");
- origin_ = GURL("http://www.google.com");
-}
+ : MockPermissionBubbleRequest("test",
+ "button",
+ "button",
+ GURL("http://www.google.com"),
+ PermissionBubbleType::UNKNOWN) {}
MockPermissionBubbleRequest::MockPermissionBubbleRequest(
const std::string& text)
- : granted_(false),
- cancelled_(false),
- finished_(false) {
- text_ = base::UTF8ToUTF16(text);
- accept_label_ = base::ASCIIToUTF16("button");
- deny_label_ = base::ASCIIToUTF16("button");
- origin_ = GURL("http://www.google.com");
-}
+ : MockPermissionBubbleRequest(text,
+ "button",
+ "button",
+ GURL("http://www.google.com"),
+ PermissionBubbleType::UNKNOWN) {}
+
+MockPermissionBubbleRequest::MockPermissionBubbleRequest(
+ const std::string& text, PermissionBubbleType bubble_type)
+ : MockPermissionBubbleRequest(text,
+ "button",
+ "button",
+ GURL("http://www.google.com"),
+ bubble_type) {}
MockPermissionBubbleRequest::MockPermissionBubbleRequest(
const std::string& text,
const GURL& url)
- : granted_(false),
- cancelled_(false),
- finished_(false) {
- text_ = base::UTF8ToUTF16(text);
- accept_label_ = base::ASCIIToUTF16("button");
- deny_label_ = base::ASCIIToUTF16("button");
- origin_ = url.GetOrigin();
-}
+ : MockPermissionBubbleRequest(text,
+ "button",
+ "button",
+ url,
+ PermissionBubbleType::UNKNOWN) {}
MockPermissionBubbleRequest::MockPermissionBubbleRequest(
const std::string& text,
const std::string& accept_label,
const std::string& deny_label)
- : granted_(false),
- cancelled_(false),
- finished_(false) {
- text_ = base::UTF8ToUTF16(text);
- accept_label_ = base::UTF8ToUTF16(accept_label);
- deny_label_ = base::UTF8ToUTF16(deny_label);
- origin_ = GURL("http://www.google.com");
-}
+ : MockPermissionBubbleRequest(text,
+ accept_label,
+ deny_label,
+ GURL("http://www.google.com"),
+ PermissionBubbleType::UNKNOWN) {}
MockPermissionBubbleRequest::~MockPermissionBubbleRequest() {}
@@ -86,6 +82,11 @@ void MockPermissionBubbleRequest::RequestFinished() {
finished_ = true;
}
+PermissionBubbleType MockPermissionBubbleRequest::GetPermissionBubbleType()
+ const {
+ return bubble_type_;
+}
+
bool MockPermissionBubbleRequest::granted() {
return granted_;
}
@@ -98,3 +99,18 @@ bool MockPermissionBubbleRequest::finished() {
return finished_;
}
+MockPermissionBubbleRequest::MockPermissionBubbleRequest(
+ const std::string& text,
+ const std::string& accept_label,
+ const std::string& deny_label,
+ const GURL& origin,
+ PermissionBubbleType bubble_type)
+ : granted_(false),
+ cancelled_(false),
+ finished_(false),
+ bubble_type_(bubble_type) {
+ text_ = base::UTF8ToUTF16(text);
+ accept_label_ = base::UTF8ToUTF16(accept_label);
+ deny_label_ = base::UTF8ToUTF16(deny_label);
+ origin_ = origin.GetOrigin();
+}

Powered by Google App Engine
This is Rietveld 408576698