OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/sad_tab.h" | 5 #include "chrome/browser/ui/sad_tab.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "chrome/browser/net/referrer.h" | 8 #include "chrome/browser/net/referrer.h" |
9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
10 #include "chrome/browser/ui/chrome_pages.h" | 10 #include "chrome/browser/ui/chrome_pages.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // This macro uses a static counter to track how many times it's hit in a | 29 // This macro uses a static counter to track how many times it's hit in a |
30 // session. See Tabs.SadTab.CrashCreated in histograms.xml for details. | 30 // session. See Tabs.SadTab.CrashCreated in histograms.xml for details. |
31 #define UMA_SAD_TAB_COUNTER(histogram_name) \ | 31 #define UMA_SAD_TAB_COUNTER(histogram_name) \ |
32 { \ | 32 { \ |
33 static int count = 0; \ | 33 static int count = 0; \ |
34 ++count; \ | 34 ++count; \ |
35 UMA_HISTOGRAM_COUNTS_1000(histogram_name, count); \ | 35 UMA_HISTOGRAM_COUNTS_1000(histogram_name, count); \ |
36 } | 36 } |
37 | 37 |
38 // This enum backs an UMA histogram, so it should be treated as append-only. | 38 // This enum backs an UMA histogram, so it should be treated as append-only. |
| 39 // A Java counterpart exists in |
| 40 // org.chromium.chrome.browser.tab.SadTabViewFactory. |
39 enum SadTabEvent { | 41 enum SadTabEvent { |
40 DISPLAYED, | 42 DISPLAYED, |
41 BUTTON_CLICKED, | 43 BUTTON_CLICKED, |
42 HELP_LINK_CLICKED, | 44 HELP_LINK_CLICKED, |
43 MAX_SAD_TAB_EVENT | 45 MAX_SAD_TAB_EVENT |
44 }; | 46 }; |
45 | 47 |
46 void RecordEvent(bool feedback, SadTabEvent event) { | 48 void RecordEvent(bool feedback, SadTabEvent event) { |
47 if (feedback) { | 49 if (feedback) { |
48 UMA_HISTOGRAM_ENUMERATION("Tabs.SadTab.Feedback.Event", event, | 50 UMA_HISTOGRAM_ENUMERATION("Tabs.SadTab.Feedback.Event", event, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // Fall through | 206 // Fall through |
205 case chrome::SAD_TAB_KIND_KILLED: | 207 case chrome::SAD_TAB_KIND_KILLED: |
206 UMA_SAD_TAB_COUNTER("Tabs.SadTab.KillCreated"); | 208 UMA_SAD_TAB_COUNTER("Tabs.SadTab.KillCreated"); |
207 LOG(WARNING) << "Tab Killed: " | 209 LOG(WARNING) << "Tab Killed: " |
208 << web_contents->GetURL().GetOrigin().spec(); | 210 << web_contents->GetURL().GetOrigin().spec(); |
209 break; | 211 break; |
210 } | 212 } |
211 } | 213 } |
212 | 214 |
213 } // namespace chrome | 215 } // namespace chrome |
OLD | NEW |