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

Side by Side Diff: chrome/browser/android/hung_renderer_infobar_delegate.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/hung_renderer_infobar_delegate.h" 5 #include "chrome/browser/android/hung_renderer_infobar_delegate.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "chrome/browser/android/android_theme_resources.h" 9 #include "chrome/browser/android/android_theme_resources.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 20 matching lines...) Expand all
31 HungRendererInfoBarDelegate::HungRendererInfoBarDelegate( 31 HungRendererInfoBarDelegate::HungRendererInfoBarDelegate(
32 content::RenderProcessHost* render_process_host) 32 content::RenderProcessHost* render_process_host)
33 : render_process_host_(render_process_host), 33 : render_process_host_(render_process_host),
34 terminal_event_logged_for_uma_(false) {} 34 terminal_event_logged_for_uma_(false) {}
35 35
36 HungRendererInfoBarDelegate::~HungRendererInfoBarDelegate() { 36 HungRendererInfoBarDelegate::~HungRendererInfoBarDelegate() {
37 if (!terminal_event_logged_for_uma_) 37 if (!terminal_event_logged_for_uma_)
38 LogEvent(TAB_CLOSED); 38 LogEvent(TAB_CLOSED);
39 } 39 }
40 40
41 infobars::InfoBarDelegate::InfoBarIdentifier
42 HungRendererInfoBarDelegate::GetIdentifier() const {
43 return HUNG_RENDERER_INFOBAR_DELEGATE;
44 }
45
41 void HungRendererInfoBarDelegate::InfoBarDismissed() { 46 void HungRendererInfoBarDelegate::InfoBarDismissed() {
42 LogEvent(CLOSE_CLICKED); 47 LogEvent(CLOSE_CLICKED);
43 } 48 }
44 49
45 HungRendererInfoBarDelegate* 50 HungRendererInfoBarDelegate*
46 HungRendererInfoBarDelegate::AsHungRendererInfoBarDelegate() { 51 HungRendererInfoBarDelegate::AsHungRendererInfoBarDelegate() {
47 return this; 52 return this;
48 } 53 }
49 54
50 int HungRendererInfoBarDelegate::GetIconId() const { 55 int HungRendererInfoBarDelegate::GetIconId() const {
(...skipping 21 matching lines...) Expand all
72 LogEvent(WAIT_CLICKED); 77 LogEvent(WAIT_CLICKED);
73 return true; 78 return true;
74 } 79 }
75 80
76 void HungRendererInfoBarDelegate::LogEvent(Event event) { 81 void HungRendererInfoBarDelegate::LogEvent(Event event) {
77 DCHECK(!terminal_event_logged_for_uma_); 82 DCHECK(!terminal_event_logged_for_uma_);
78 terminal_event_logged_for_uma_ = true; 83 terminal_event_logged_for_uma_ = true;
79 UMA_HISTOGRAM_ENUMERATION("Renderer.Hung.MobileInfoBar.UserEvent", event, 84 UMA_HISTOGRAM_ENUMERATION("Renderer.Hung.MobileInfoBar.UserEvent", event,
80 EVENT_COUNT); 85 EVENT_COUNT);
81 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698