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

Side by Side Diff: chrome/browser/translate/translate_infobars_delegates.cc

Issue 853010: Adding UMA stats to the translate UI so we can get user usage... (Closed) Base URL: svn://chrome-svn/chrome/branches/249/src/
Patch Set: Created 10 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/translate/translate_infobars_delegates.h" 5 #include "chrome/browser/translate/translate_infobars_delegates.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/renderer_host/translation_service.h" 10 #include "chrome/browser/renderer_host/translation_service.h"
(...skipping 14 matching lines...) Expand all
25 // There can be only 1 translate infobar at any one time. 25 // There can be only 1 translate infobar at any one time.
26 return (!!translate_delegate); 26 return (!!translate_delegate);
27 } 27 }
28 28
29 void TranslateInfoBarDelegate::InfoBarDismissed() { 29 void TranslateInfoBarDelegate::InfoBarDismissed() {
30 LanguageState& language_state = tab_contents_->language_state(); 30 LanguageState& language_state = tab_contents_->language_state();
31 if (!language_state.IsPageTranslated() && 31 if (!language_state.IsPageTranslated() &&
32 !language_state.translation_pending()) { 32 !language_state.translation_pending()) {
33 // The user closed the infobar without clicking the translate button. 33 // The user closed the infobar without clicking the translate button.
34 TranslationDeclined(); 34 TranslationDeclined();
35 UMA_HISTOGRAM_COUNTS("Translate.DeclineTranslateCloseInfobar", 1);
35 } 36 }
36 } 37 }
37 38
38 void TranslateInfoBarDelegate::InfoBarClosed() { 39 void TranslateInfoBarDelegate::InfoBarClosed() {
39 delete this; 40 delete this;
40 } 41 }
41 42
42 // TranslateInfoBarDelegate: public: ------------------------------------------- 43 // TranslateInfoBarDelegate: public: -------------------------------------------
43 44
44 void TranslateInfoBarDelegate::UpdateState(TranslateState new_state) { 45 void TranslateInfoBarDelegate::UpdateState(TranslateState new_state) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 original_lang_index_(original_lang_index), 210 original_lang_index_(original_lang_index),
210 target_lang_index_(target_lang_index), 211 target_lang_index_(target_lang_index),
211 never_translate_language_(false), 212 never_translate_language_(false),
212 never_translate_site_(false), 213 never_translate_site_(false),
213 always_translate_(false) { 214 always_translate_(false) {
214 TranslationService::GetSupportedLanguages(&supported_languages_); 215 TranslationService::GetSupportedLanguages(&supported_languages_);
215 DCHECK(original_lang_index_ > -1); 216 DCHECK(original_lang_index_ > -1);
216 DCHECK(target_lang_index_ > -1); 217 DCHECK(target_lang_index_ > -1);
217 } 218 }
218 219
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698