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

Unified Diff: chrome/browser/ui/toolbar/action_box_button_controller.cc

Issue 11017042: Added UMA metrics for ActionBox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | chrome/tools/chromeactions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/action_box_button_controller.cc
diff --git a/chrome/browser/ui/toolbar/action_box_button_controller.cc b/chrome/browser/ui/toolbar/action_box_button_controller.cc
index 9010131a9e9e052b5524194973c3cc08d05af6a7..396743e883ecfd55b2270caf2022c02e7afece04 100644
--- a/chrome/browser/ui/toolbar/action_box_button_controller.cc
+++ b/chrome/browser/ui/toolbar/action_box_button_controller.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/toolbar/action_box_button_controller.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
@@ -20,6 +21,7 @@
#include "chrome/common/extensions/extension_set.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_intents_dispatcher.h"
#include "grit/generated_resources.h"
@@ -28,6 +30,12 @@
namespace {
+// This indicates we need to send UMA data about the number of
+// "Share with X" commands shown in the menu after user tried to
+// find share extensions from web store or the first use of action
+// box after browser starts.
+static bool send_uma_share_command_count = true;
+
// Share intents get command IDs that are beyond the maximal valid command ID
// (0xDFFF) so that they are not confused with actual commands that appear in
// the menu. Extensions get a reserved block of commands after share handlers.
@@ -46,6 +54,8 @@ const char kShareIntentMimeType[] = "text/uri-list";
} // namespace
+using content::UserMetricsAction;
+
ActionBoxButtonController::ActionBoxButtonController(Browser* browser,
Delegate* delegate)
: browser_(browser),
@@ -100,6 +110,14 @@ void ActionBoxButtonController::OnButtonClicked() {
// Add link to the Web Store to find additional share intents.
menu_model->AddItemWithStringId(CWS_FIND_SHARE_INTENTS_COMMAND,
IDS_FIND_SHARE_INTENTS);
+
+ content::RecordAction(UserMetricsAction("ActionBox.ClickButton"));
+ if (send_uma_share_command_count) {
+ UMA_HISTOGRAM_ENUMERATION("ActionBox.ShareCommandCount",
+ next_share_intent_command_id - SHARE_COMMAND_FIRST,
+ kMaxShareItemsToShow + 1);
+ send_uma_share_command_count = false;
+ }
}
// Add Extensions.
@@ -225,4 +243,7 @@ void ActionBoxButtonController::NavigateToWebStoreShareIntentsList() {
content::PAGE_TRANSITION_LINK);
params.disposition = NEW_FOREGROUND_TAB;
chrome::Navigate(&params);
+
+ content::RecordAction(UserMetricsAction("ActionBox.FindShareHandlers"));
+ send_uma_share_command_count = true;
}
« no previous file with comments | « no previous file | chrome/tools/chromeactions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698