Commit d59a713c authored by glevin's avatar glevin Committed by Commit bot

Uma stats for Data Saver prompt

BUG=475194

Collects UMA stats for
(i) how  many times the Data Saver prompt (notification) is shown, and
(ii) how many times the Data Saver prompt is clicked on.

Review URL: https://codereview.chromium.org/1106173003

Cr-Commit-Position: refs/heads/master@{#327490}
parent d6983032
......@@ -28,6 +28,7 @@
#include "chromeos/network/network_event_log.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "content/public/browser/user_metrics.h"
#include "extensions/browser/extension_registry.h"
#include "grit/ui_chromeos_resources.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
......@@ -171,6 +172,8 @@ void NotificationClicked(const std::string& service_path,
chrome::ScopedTabbedBrowserDisplayer displayer(
ProfileManager::GetPrimaryUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH);
chrome::ShowSingletonTab(displayer.browser(), GURL(info_url));
if (info_url == kDataSaverExtensionUrl)
content::RecordAction(base::UserMetricsAction("DataSaverPrompt_Clicked"));
} else {
ui::NetworkConnect::Get()->ShowNetworkSettingsForPath(service_path);
}
......@@ -308,6 +311,7 @@ bool DataPromoNotification::ShowDataSaverNotification() {
kDataSaverNotificationId, title, message, icon,
ui::NetworkStateNotifier::kNotifierNetwork,
base::Bind(&NotificationClicked, "", kDataSaverExtensionUrl)));
content::RecordAction(base::UserMetricsAction("DataSaverPrompt_Shown"));
if (DataSaverSwitchDemoMode()) {
SetDataSaverPromptsShown(0); // demo mode resets times shown counts.
......
......@@ -2422,6 +2422,20 @@ should be able to be added at any place in this file.
</obsolete>
</action>
<action name="DataSaverPrompt_Clicked">
<owner>glevin@chromium.org</owner>
<description>
Records click on prompt (notification) to install Data Saver extension.
</description>
</action>
<action name="DataSaverPrompt_Shown">
<owner>glevin@chromium.org</owner>
<description>
Records display of prompt (notification) to install Data Saver extension.
</description>
</action>
<action name="Debugger">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment