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

Unified Diff: chrome/browser/guestview/webview/webview_guest.cc

Issue 69913002: Add UMA for <webview> APIs: a. ClearData, b. when Permission request is allowed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refine by permission granularity. Created 7 years, 1 month 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/guestview/webview/webview_guest.cc
diff --git a/chrome/browser/guestview/webview/webview_guest.cc b/chrome/browser/guestview/webview/webview_guest.cc
index ac7f926bb25caaf1126afe501db21fe2e313cee5..c058119ee3d0668f221e81547faf374d49694ba3 100644
--- a/chrome/browser/guestview/webview/webview_guest.cc
+++ b/chrome/browser/guestview/webview/webview_guest.cc
@@ -312,7 +312,7 @@ bool WebViewGuest::RequestPermission(
// If there are too many pending permission requests then reject this request.
if (pending_permission_requests_.size() >=
webview::kMaxOutstandingPermissionRequests) {
- callback.Run(false, std::string());
+ callback.Run(false, std::string(), false);
return true;
}
@@ -331,7 +331,7 @@ bool WebViewGuest::RequestPermission(
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel > chrome::VersionInfo::CHANNEL_DEV) {
// 'dialog' API is not available in stable/beta.
- callback.Run(false, std::string());
+ callback.Run(false, std::string(), false);
return true;
}
DispatchEvent(new GuestView::Event(webview::kEventDialog,
@@ -403,7 +403,7 @@ WebViewGuest::SetPermissionResult WebViewGuest::SetPermission(
bool allow = (action == ALLOW) ||
((action == DEFAULT) && info.allowed_by_default);
- info.callback.Run(allow, user_input);
+ info.callback.Run(allow, user_input, action != DEFAULT);
pending_permission_requests_.erase(request_itr);
return allow ? SET_PERMISSION_ALLOWED : SET_PERMISSION_DENIED;
@@ -434,6 +434,7 @@ void WebViewGuest::Terminate() {
bool WebViewGuest::ClearData(const base::Time remove_since,
uint32 removal_mask,
const base::Closure& callback) {
+ content::RecordAction(content::UserMetricsAction("WebView.Guest.ClearData"));
content::StoragePartition* partition =
content::BrowserContext::GetStoragePartition(
web_contents()->GetBrowserContext(),

Powered by Google App Engine
This is Rietveld 408576698