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

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

Issue 10406005: Update UMA histograms as discussed with jar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/network_profile_bubble.cc
diff --git a/chrome/browser/ui/views/network_profile_bubble.cc b/chrome/browser/ui/views/network_profile_bubble.cc
index 1496c179a3e0a61e38c3fefa749e1cd3b25804e8..4f72e414ab89504e0a22bc27c2cc661f036a09e2 100644
--- a/chrome/browser/ui/views/network_profile_bubble.cc
+++ b/chrome/browser/ui/views/network_profile_bubble.cc
@@ -42,6 +42,33 @@ const int kAnchorVerticalInset = 5;
const int kInset = 2;
const int kNotificationBubbleWidth = 250;
+// The name of the UMA histogram collecting our stats.
+const char kMetricNetworkedProfileCheck[] = "NetworkedProfile.Check";
+
+enum MetricNetworkedProfileCheck {
+ // Check was suppressed by command line flag.
+ kMetricCheckSuppressed,
sky 2012/05/16 15:47:42 Chrome uses FOO_BAR style for enums.
pastarmovj 2012/05/16 15:55:57 Sorry about that. I was looking at a bad example i
+ // WTSQuerySessionInformation call failed.
+ kMetricCheckFailed,
+ // File access in profile dir failed.
+ kMetricCheckIOFailed,
+
+ // Profile on a network share detected.
+ kMetricProfileOnNetwork,
+ // Profile not on a network share detected.
+ kMetricProfileNotOnNetwork,
+
+ // Check was suppressed because of remote session.
+ kMetricRemoteSession,
+
+ // User has clicked learn more on the notification bubble.
+ kMetricLearnMoreClicked,
+ // User has clicked OK on the notification bubble.
+ kMetricAcknowledged,
+
+ kMetricNetworkedProfileCheckSize // Must be the last.
+};
+
// Implementation of BrowserList::Observer used to wait for a browser window.
class BrowserListObserver : public BrowserList::Observer {
private:
@@ -91,7 +118,9 @@ void NetworkProfileBubble::CheckNetworkProfile(const FilePath& profile_path) {
// wild often enough.
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kNoNetworkProfileWarning)) {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.CheckSuppressed", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricCheckSuppressed,
+ kMetricNetworkedProfileCheckSize);
return;
}
@@ -102,7 +131,9 @@ void NetworkProfileBubble::CheckNetworkProfile(const FilePath& profile_path) {
if (!WTSQuerySessionInformation(WTS_CURRENT_SERVER, WTS_CURRENT_SESSION,
WTSClientProtocolType,
&buffer, &buffer_length)) {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.CheckFailed", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricCheckFailed,
+ kMetricNetworkedProfileCheckSize);
return;
}
@@ -121,20 +152,28 @@ void NetworkProfileBubble::CheckNetworkProfile(const FilePath& profile_path) {
if (!file_util::NormalizeFilePath(temp_file, &normalized_temp_file))
profile_on_network = true;
} else {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.CheckIOFailed", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricCheckIOFailed,
+ kMetricNetworkedProfileCheckSize);
}
file_util::Delete(temp_file, false);
}
if (profile_on_network) {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.ProfileOnNetwork", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricProfileOnNetwork,
+ kMetricNetworkedProfileCheckSize);
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&NetworkProfileBubble::NotifyNetworkProfileDetected));
} else {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.ProfileNotOnNetwork", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricProfileNotOnNetwork,
+ kMetricNetworkedProfileCheckSize);
}
} else {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.RemoteSession", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricRemoteSession,
+ kMetricNetworkedProfileCheckSize);
}
WTSFreeMemory(buffer);
@@ -233,7 +272,9 @@ gfx::Rect NetworkProfileBubble::GetAnchorRect() {
}
void NetworkProfileBubble::LinkClicked(views::Link* source, int event_flags) {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.LearnMoreClicked", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricLearnMoreClicked,
+ kMetricNetworkedProfileCheckSize);
Browser* browser = BrowserList::GetLastActive();
if (browser) {
WindowOpenDisposition disposition =
@@ -256,7 +297,9 @@ void NetworkProfileBubble::LinkClicked(views::Link* source, int event_flags) {
void NetworkProfileBubble::ButtonPressed(views::Button* sender,
const views::Event& event) {
- UMA_HISTOGRAM_COUNTS("NetworkedProfile.Acknowledged", 1);
+ UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
+ kMetricAcknowledged,
+ kMetricNetworkedProfileCheckSize);
GetWidget()->Close();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698