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

Side by Side Diff: chrome/browser/ui/views/translate/translate_bubble_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
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_bubble_view.h" 5 #include "chrome/browser/ui/views/translate/translate_bubble_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "ui/views/controls/label.h" 44 #include "ui/views/controls/label.h"
45 #include "ui/views/controls/link.h" 45 #include "ui/views/controls/link.h"
46 #include "ui/views/controls/styled_label.h" 46 #include "ui/views/controls/styled_label.h"
47 #include "ui/views/layout/box_layout.h" 47 #include "ui/views/layout/box_layout.h"
48 #include "ui/views/layout/grid_layout.h" 48 #include "ui/views/layout/grid_layout.h"
49 #include "ui/views/layout/layout_constants.h" 49 #include "ui/views/layout/layout_constants.h"
50 #include "ui/views/widget/widget.h" 50 #include "ui/views/widget/widget.h"
51 51
52 namespace { 52 namespace {
53 53
54 const char kTranslateBubbleUIEvent[] = "Translate.BubbleUiEvent";
55
56 views::LabelButton* CreateBlueButton(views::ButtonListener* listener, 54 views::LabelButton* CreateBlueButton(views::ButtonListener* listener,
57 const base::string16& label, 55 const base::string16& label,
58 int id) { 56 int id) {
59 views::LabelButton* button = new views::BlueButton(listener, label); 57 views::LabelButton* button = new views::BlueButton(listener, label);
60 button->set_id(id); 58 button->set_id(id);
61 return button; 59 return button;
62 } 60 }
63 61
64 views::LabelButton* CreateLabelButton(views::ButtonListener* listener, 62 views::LabelButton* CreateLabelButton(views::ButtonListener* listener,
65 const base::string16& label, 63 const base::string16& label,
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 else 931 else
934 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); 932 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT);
935 advanced_done_button_->SetText(label); 933 advanced_done_button_->SetText(label);
936 advanced_done_button_->SizeToPreferredSize(); 934 advanced_done_button_->SizeToPreferredSize();
937 if (advanced_view_) 935 if (advanced_view_)
938 advanced_view_->Layout(); 936 advanced_view_->Layout();
939 } 937 }
940 938
941 void TranslateBubbleView::ReportUiAction( 939 void TranslateBubbleView::ReportUiAction(
942 translate::TranslateBubbleUiEvent action) { 940 translate::TranslateBubbleUiEvent action) {
943 UMA_HISTOGRAM_ENUMERATION(kTranslateBubbleUIEvent, action, 941 UMA_HISTOGRAM_ENUMERATION(translate::kTranslateBubbleUIEvent, action,
944 translate::TRANSLATE_BUBBLE_UI_EVENT_MAX); 942 translate::TRANSLATE_BUBBLE_UI_EVENT_MAX);
945 } 943 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/bubble_icon_view.cc ('k') | chrome/browser/ui/views/translate/translate_icon_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698