diff options
Diffstat (limited to 'chrome/browser/translate/translate_infobar_delegate.cc')
-rw-r--r-- | chrome/browser/translate/translate_infobar_delegate.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc index 0a00819..1fd2271 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -111,29 +111,29 @@ void TranslateInfoBarDelegate::SetTargetLanguage(size_t language_index) { void TranslateInfoBarDelegate::Translate() { const std::string& original_language_code = GetOriginalLanguageCode(); - if (!owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord()) { + if (!owner()->web_contents()->GetBrowserContext()->IsOffTheRecord()) { prefs_.ResetTranslationDeniedCount(original_language_code); prefs_.IncrementTranslationAcceptedCount(original_language_code); } - TranslateManager::GetInstance()->TranslatePage(owner()->tab_contents(), + TranslateManager::GetInstance()->TranslatePage(owner()->web_contents(), GetLanguageCodeAt(original_language_index()), GetLanguageCodeAt(target_language_index())); } void TranslateInfoBarDelegate::RevertTranslation() { - TranslateManager::GetInstance()->RevertTranslation(owner()->tab_contents()); + TranslateManager::GetInstance()->RevertTranslation(owner()->web_contents()); RemoveSelf(); } void TranslateInfoBarDelegate::ReportLanguageDetectionError() { TranslateManager::GetInstance()-> - ReportLanguageDetectionError(owner()->tab_contents()); + ReportLanguageDetectionError(owner()->web_contents()); } void TranslateInfoBarDelegate::TranslationDeclined() { const std::string& original_language_code = GetOriginalLanguageCode(); - if (!owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord()) { + if (!owner()->web_contents()->GetBrowserContext()->IsOffTheRecord()) { prefs_.ResetTranslationAcceptedCount(original_language_code); prefs_.IncrementTranslationDeniedCount(original_language_code); } @@ -144,7 +144,7 @@ void TranslateInfoBarDelegate::TranslationDeclined() { // happens when a load stops. That could happen multiple times, including // after the user already declined the translation.) TranslateTabHelper* helper = TabContentsWrapper::GetCurrentWrapperForContents( - owner()->tab_contents())->translate_tab_helper(); + owner()->web_contents())->translate_tab_helper(); helper->language_state().set_translation_declined(true); } @@ -260,7 +260,7 @@ void TranslateInfoBarDelegate::MessageInfoBarButtonPressed() { return; } // This is the "Try again..." case. - TranslateManager::GetInstance()->TranslatePage(owner()->tab_contents(), + TranslateManager::GetInstance()->TranslatePage(owner()->web_contents(), GetOriginalLanguageCode(), GetTargetLanguageCode()); } @@ -270,13 +270,13 @@ bool TranslateInfoBarDelegate::ShouldShowMessageInfoBarButton() { bool TranslateInfoBarDelegate::ShouldShowNeverTranslateButton() { DCHECK_EQ(BEFORE_TRANSLATE, type_); - return !owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord() && + return !owner()->web_contents()->GetBrowserContext()->IsOffTheRecord() && (prefs_.GetTranslationDeniedCount(GetOriginalLanguageCode()) >= 3); } bool TranslateInfoBarDelegate::ShouldShowAlwaysTranslateButton() { DCHECK_EQ(BEFORE_TRANSLATE, type_); - return !owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord() && + return !owner()->web_contents()->GetBrowserContext()->IsOffTheRecord() && (prefs_.GetTranslationAcceptedCount(GetOriginalLanguageCode()) >= 3); } @@ -399,6 +399,6 @@ TranslateInfoBarDelegate* std::string TranslateInfoBarDelegate::GetPageHost() { NavigationEntry* entry = - owner()->tab_contents()->GetController().GetActiveEntry(); + owner()->web_contents()->GetController().GetActiveEntry(); return entry ? entry->GetURL().HostNoBrackets() : std::string(); } |