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

Unified Diff: chrome/browser/translate/translate_infobar_delegate.cc

Issue 58233002: [Translate] Use the UIDelegate implementation of TranslationDeclined() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_infobar_delegate.cc
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index 68511a6e74973334f26871e10128bbd0a68f6d3f..c5e7044f91a9513c312f703a1f15867cb2ff3c55 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -27,10 +27,6 @@
using content::NavigationEntry;
namespace {
-
-// TODO(hajimehoshi): Remove this after crbug/283720 is solved.
-const char kDeclineTranslate[] = "Translate.DeclineTranslate";
-
const char kCloseInfobar[] = "Translate.DeclineTranslateCloseInfobar";
const char kShowErrorInfobar[] = "Translate.ShowErrorInfobar";
@@ -126,26 +122,7 @@ void TranslateInfoBarDelegate::ReportLanguageDetectionError() {
}
void TranslateInfoBarDelegate::TranslationDeclined() {
- // TODO(miguelg) switch this back to just calling web_contents()
- // once we've diagnosed crbug/283720
- // TODO(hajimehoshi): Replace this implementstion with calling ui_delegate_.
- // TranslationDeclined() after miguelg's investigating.
- content::WebContents* contents = owner()->web_contents();
- content::BrowserContext* context = contents->GetBrowserContext();
- if (!context->IsOffTheRecord()) {
- prefs_.ResetTranslationAcceptedCount(original_language_code());
- prefs_.IncrementTranslationDeniedCount(original_language_code());
- }
-
- // Remember that the user declined the translation so as to prevent showing a
- // translate infobar for that page again. (TranslateManager initiates
- // translations when getting a LANGUAGE_DETERMINED from the page, which
- // happens when a load stops. That could happen multiple times, including
- // after the user already declined the translation.)
- TranslateTabHelper::FromWebContents(web_contents())->
- language_state().set_translation_declined(true);
-
- UMA_HISTOGRAM_BOOLEAN(kDeclineTranslate, true);
+ ui_delegate_.TranslationDeclined();
}
bool TranslateInfoBarDelegate::IsTranslatableLanguageByPrefs() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698