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

Side by Side 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: address review comments 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/translate/translate_icon_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/translate/translate_icon_view.h" 5 #include "chrome/browser/ui/views/translate/translate_icon_view.h"
6 6
7 #include "base/metrics/histogram_macros.h"
7 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
11 #include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h"
10 #include "chrome/browser/ui/view_ids.h" 12 #include "chrome/browser/ui/view_ids.h"
11 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" 13 #include "chrome/browser/ui/views/translate/translate_bubble_view.h"
12 #include "chrome/grit/generated_resources.h" 14 #include "chrome/grit/generated_resources.h"
13 #include "grit/theme_resources.h" 15 #include "grit/theme_resources.h"
14 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
15 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
16 #include "ui/gfx/vector_icons_public.h" 18 #include "ui/gfx/vector_icons_public.h"
17 19
18 TranslateIconView::TranslateIconView(CommandUpdater* command_updater) 20 TranslateIconView::TranslateIconView(CommandUpdater* command_updater)
19 : BubbleIconView(command_updater, IDC_TRANSLATE_PAGE) { 21 : BubbleIconView(command_updater, IDC_TRANSLATE_PAGE) {
20 set_id(VIEW_ID_TRANSLATE_BUTTON); 22 set_id(VIEW_ID_TRANSLATE_BUTTON);
21 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TRANSLATE)); 23 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TRANSLATE));
22 } 24 }
23 25
24 TranslateIconView::~TranslateIconView() {} 26 TranslateIconView::~TranslateIconView() {}
25 27
26 void TranslateIconView::OnExecuting( 28 void TranslateIconView::OnExecuting(
27 BubbleIconView::ExecuteSource execute_source) {} 29 BubbleIconView::ExecuteSource execute_source) {}
28 30
31 void TranslateIconView::OnPressed(bool activated) {
32 UMA_HISTOGRAM_ENUMERATION(
33 translate::kTranslateBubbleUIEvent,
34 (activated ? translate::PAGE_ACTION_ICON_ACTIVATED
35 : translate::PAGE_ACTION_ICON_DEACTIVATED),
36 translate::TRANSLATE_BUBBLE_UI_EVENT_MAX);
37 }
38
29 views::BubbleDialogDelegateView* TranslateIconView::GetBubble() const { 39 views::BubbleDialogDelegateView* TranslateIconView::GetBubble() const {
30 return TranslateBubbleView::GetCurrentBubble(); 40 return TranslateBubbleView::GetCurrentBubble();
31 } 41 }
32 42
33 gfx::VectorIconId TranslateIconView::GetVectorIcon() const { 43 gfx::VectorIconId TranslateIconView::GetVectorIcon() const {
34 return gfx::VectorIconId::TRANSLATE; 44 return gfx::VectorIconId::TRANSLATE;
35 } 45 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/translate/translate_icon_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698