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

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: Change after revised button/menu implementation 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 | « chrome/browser/ui/toolbar/action_box_button_controller.h ('k') | 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..b922d699c6673f268c8daca9e2b886beecc19d5f 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"
@@ -46,11 +48,14 @@ const char kShareIntentMimeType[] = "text/uri-list";
} // namespace
+using content::UserMetricsAction;
+
ActionBoxButtonController::ActionBoxButtonController(Browser* browser,
Delegate* delegate)
: browser_(browser),
delegate_(delegate),
- next_extension_command_id_(EXTENSION_COMMAND_FIRST) {
+ next_extension_command_id_(EXTENSION_COMMAND_FIRST),
+ should_send_uma_(true) {
DCHECK(browser_);
DCHECK(delegate_);
registrar_.Add(this,
@@ -100,6 +105,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 (should_send_uma_) {
skare_ 2012/10/17 00:29:15 logic and stat look good, perhaps call this send_u
Wei Li 2012/10/17 05:23:06 Done.
+ UMA_HISTOGRAM_ENUMERATION("ActionBox.ShareCommandCount",
+ next_share_intent_command_id - SHARE_COMMAND_FIRST,
+ SHARE_COMMAND_LAST);
skare_ 2012/10/17 00:29:15 I'm new to Chrome UMA but should this be kMaxShare
Wei Li 2012/10/17 05:23:06 Done. Nice catch. I didn't notice the start value
+ should_send_uma_ = false;
+ }
}
// Add Extensions.
@@ -225,4 +238,7 @@ void ActionBoxButtonController::NavigateToWebStoreShareIntentsList() {
content::PAGE_TRANSITION_LINK);
params.disposition = NEW_FOREGROUND_TAB;
chrome::Navigate(&params);
+
+ content::RecordAction(UserMetricsAction("ActionBox.FindShares"));
+ should_send_uma_ = true;
}
« no previous file with comments | « chrome/browser/ui/toolbar/action_box_button_controller.h ('k') | chrome/tools/chromeactions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698