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(); |
} |