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

Unified Diff: chrome/browser/ui/views/translate/translate_icon_view.cc

Issue 1962393003: log the click activate/deactive of translate icon on location bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed by 'git cl format --full' Created 4 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
Index: chrome/browser/ui/views/translate/translate_icon_view.cc
diff --git a/chrome/browser/ui/views/translate/translate_icon_view.cc b/chrome/browser/ui/views/translate/translate_icon_view.cc
index 1b1d24cabab6e50fc8058d8ad4f476ef1e977dc0..bf81a1aba7eb041dfa3065563dd00a6d43d19c84 100644
--- a/chrome/browser/ui/views/translate/translate_icon_view.cc
+++ b/chrome/browser/ui/views/translate/translate_icon_view.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/ui/views/translate/translate_icon_view.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/browser_commands.h"
+#include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/translate/translate_bubble_view.h"
#include "chrome/grit/generated_resources.h"
@@ -15,6 +17,12 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/vector_icons_public.h"
+namespace {
+
+const char kTranslateBubbleUIEvent[] = "Translate.BubbleUiEvent";
msw 2016/05/11 18:51:35 nit: define this string constant elsewhere for use
ftang 2016/05/11 23:20:23 Done.
+
+} // namespace
+
TranslateIconView::TranslateIconView(CommandUpdater* command_updater)
: BubbleIconView(command_updater, IDC_TRANSLATE_PAGE) {
set_id(VIEW_ID_TRANSLATE_BUTTON);
@@ -23,6 +31,14 @@ TranslateIconView::TranslateIconView(CommandUpdater* command_updater)
TranslateIconView::~TranslateIconView() {}
+void TranslateIconView::OnClicked(bool activated) {
+ UMA_HISTOGRAM_ENUMERATION(
+ kTranslateBubbleUIEvent,
+ (activated ? translate::OMNIBAR_ICON_CLICK_ACTIVATE
+ : translate::OMNIBAR_ICON_CLICK_DEACTIVATE),
+ translate::TRANSLATE_BUBBLE_UI_EVENT_MAX);
+}
+
void TranslateIconView::OnExecuting(
BubbleIconView::ExecuteSource execute_source) {}

Powered by Google App Engine
This is Rietveld 408576698