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

Unified Diff: chrome/browser/ui/views/hung_renderer_view.cc

Issue 819163002: Add UMA actions for elements on the Hung Renderer Dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/hung_renderer_view.cc
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index 5d2503c9bd33a081035fbe228e8d2a0cb34ca187..201ae8d4b808981ac28988b8832a4b18411e353f 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -20,6 +20,7 @@
#include "components/web_modal/web_contents_modal_dialog_host.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.h"
#include "content/public/common/result_codes.h"
#include "grit/theme_resources.h"
@@ -43,6 +44,7 @@
#include "ui/views/win/hwnd_util.h"
#endif
+using base::UserMetricsAction;
using content::WebContents;
HungRendererDialogView* HungRendererDialogView::g_instance_ = NULL;
@@ -283,6 +285,7 @@ void HungRendererDialogView::ShowForWebContents(WebContents* contents) {
// one is showing.
hung_pages_table_model_->InitForWebContents(contents);
GetWidget()->Show();
+ content::RecordAction(UserMetricsAction("HungRendererDialogView.Shown"));
msw 2015/01/02 22:58:35 Should this be outside of the active Widget check?
}
}
@@ -292,6 +295,7 @@ void HungRendererDialogView::EndForWebContents(WebContents* contents) {
hung_pages_table_model_->GetRenderProcessHost() ==
contents->GetRenderProcessHost()) {
GetWidget()->Close();
+ content::RecordAction(UserMetricsAction("HungRendererDialogView.Closed"));
msw 2015/01/02 22:58:35 Should this also be recorded in HungRendererDialog
// Close is async, make sure we drop our references to the tab immediately
// (it may be going away).
hung_pages_table_model_->InitForWebContents(NULL);
@@ -338,12 +342,18 @@ views::View* HungRendererDialogView::CreateExtraView() {
bool HungRendererDialogView::Accept(bool window_closing) {
// Don't do anything if we're being called only because the dialog is being
// destroyed and we don't supply a Cancel function...
- if (window_closing)
+ if (window_closing) {
+ content::RecordAction(
+ UserMetricsAction("HungRendererDialogView.CloseButton"));
return true;
+ }
// Start waiting again for responsiveness.
- if (hung_pages_table_model_->GetRenderViewHost())
+ if (hung_pages_table_model_->GetRenderViewHost()) {
+ content::RecordAction(
+ UserMetricsAction("HungRendererDialogView.WaitButton"));
hung_pages_table_model_->GetRenderViewHost()->RestartHangMonitorTimeout();
+ }
return true;
}
@@ -365,6 +375,8 @@ void HungRendererDialogView::ButtonPressed(
views::Button* sender, const ui::Event& event) {
if (sender == kill_button_ &&
hung_pages_table_model_->GetRenderProcessHost()) {
+ content::RecordAction(
+ UserMetricsAction("HungRendererDialogView.KillButton"));
KillRendererProcess(hung_pages_table_model_->GetRenderProcessHost());
}
}
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698