diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-13 01:45:34 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-13 01:45:34 +0000 |
commit | 6afb7ba3aedafb79c1b28bc29c2123b06015596a (patch) | |
tree | 863aa9d4a7b5a0404cb79a6831814c013e6268aa /chrome/browser/translate | |
parent | 03682aab89f6808e0c7a30d5973d882dccbea53c (diff) | |
download | chromium_src-6afb7ba3aedafb79c1b28bc29c2123b06015596a.zip chromium_src-6afb7ba3aedafb79c1b28bc29c2123b06015596a.tar.gz chromium_src-6afb7ba3aedafb79c1b28bc29c2123b06015596a.tar.bz2 |
Revert "implement improvements for translate infobar"
This reverts commit r41510.
Review URL: http://codereview.chromium.org/854012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate')
-rw-r--r-- | chrome/browser/translate/translate_infobars_delegates.cc | 12 | ||||
-rw-r--r-- | chrome/browser/translate/translate_infobars_delegates.h | 7 |
2 files changed, 2 insertions, 17 deletions
diff --git a/chrome/browser/translate/translate_infobars_delegates.cc b/chrome/browser/translate/translate_infobars_delegates.cc index 174ca08..948e337 100644 --- a/chrome/browser/translate/translate_infobars_delegates.cc +++ b/chrome/browser/translate/translate_infobars_delegates.cc @@ -42,7 +42,6 @@ void TranslateInfoBarDelegate::InfoBarClosed() { // TranslateInfoBarDelegate: public: ------------------------------------------- void TranslateInfoBarDelegate::UpdateState(TranslateState new_state) { - translation_pending_ = false; if (state_ != new_state) state_ = new_state; } @@ -68,17 +67,11 @@ void TranslateInfoBarDelegate::GetAvailableTargetLanguages( } void TranslateInfoBarDelegate::Translate() { - // We only really send page for translation if original and target languages - // are different, so only in this case is translation really pending. - if (original_lang_index_ != target_lang_index_) - translation_pending_ = true; + if (state_ == kBeforeTranslate) + UpdateState(kTranslating); tab_contents_->TranslatePage(original_lang_code(), target_lang_code()); } -void TranslateInfoBarDelegate::RevertTranslation() { - tab_contents_->RevertTranslatedPage(); -} - void TranslateInfoBarDelegate::TranslationDeclined() { // Remember that the user declined the translation so as to prevent showing a // translate infobar for that page again. (TranslateManager initiates @@ -231,7 +224,6 @@ TranslateInfoBarDelegate::TranslateInfoBarDelegate(TabContents* tab_contents, tab_contents_(tab_contents), prefs_(user_prefs), state_(state), - translation_pending_(false), site_(url.HostNoBrackets()), original_lang_index_(original_lang_index), target_lang_index_(target_lang_index), diff --git a/chrome/browser/translate/translate_infobars_delegates.h b/chrome/browser/translate/translate_infobars_delegates.h index 30e4346..ce8cede 100644 --- a/chrome/browser/translate/translate_infobars_delegates.h +++ b/chrome/browser/translate/translate_infobars_delegates.h @@ -16,8 +16,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { public: enum TranslateState { kBeforeTranslate = 1, - // TODO(playmobil or erg): remove kTranslating state when mac and linux code - // have been updated to use transaction_pending() instead. kTranslating, kAfterTranslate, kTranslationFailed, @@ -38,7 +36,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { void ModifyOriginalLanguage(int lang_index); void ModifyTargetLanguage(int lang_index); void Translate(); - void RevertTranslation(); void TranslationDeclined(); bool IsLanguageBlacklisted(); void ToggleLanguageBlacklist(); @@ -68,9 +65,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { TranslateState state() const { return state_; } - bool translation_pending() const { - return translation_pending_; - } // Retrieve the text for the toolbar label. The toolbar label is a bit // strange since we need to place popup menus inside the string in question. @@ -116,7 +110,6 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { TabContents* tab_contents_; // Weak. TranslatePrefs prefs_; TranslateState state_; - bool translation_pending_; std::string site_; int original_lang_index_; int target_lang_index_; |