diff options
author | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 19:51:34 +0000 |
---|---|---|
committer | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 19:51:34 +0000 |
commit | d9118b8046804a8a185ab058a353a721e668858f (patch) | |
tree | c41186f1578cd544ed0c628d0fec02ecfe0d27f7 /chrome/browser/translate | |
parent | f04dd303e05da3227edef00c1d25785f38d5ffdb (diff) | |
download | chromium_src-d9118b8046804a8a185ab058a353a721e668858f.zip chromium_src-d9118b8046804a8a185ab058a353a721e668858f.tar.gz chromium_src-d9118b8046804a8a185ab058a353a721e668858f.tar.bz2 |
first part of fix for dual translate infobars
bug is caused by 2 problems when happen during reload of a translated page:
1) infobar container was removing the wrong infobar, which this cl fixes.
2) notification NAV_ENTRY_COMMITTED is being processed by translate-manager first, then tab-contents
- translate manager would remove all infobars, then add before-translate infobar
- tab contents then removes expired infobars -- since a reload renders an infobar irrelevant, the before-translate that just got added during the same notification is removed
- b4 this cl, because of the bug in infobar container, dual infobars were displayed
- with this cl, removing the correct infobar means no translate infobar is shown, which is also wrong.
BUG=35482
TEST=none for now.
Review URL: http://codereview.chromium.org/604028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate')
-rw-r--r-- | chrome/browser/translate/translate_manager.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 2b23e07..5f24cb6 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -139,7 +139,7 @@ void TranslateManager::InitiateTranslation(TabContents* tab, // translate related infobars as they would prevent any new infobar from // showing. (As TabContents will not add an infobar if there is already one // showing equal to the one being added.) - for (int i = 0; i < tab->infobar_delegate_count(); ++i) { + for (int i = tab->infobar_delegate_count() - 1; i >= 0; --i) { InfoBarDelegate* info_bar = tab->GetInfoBarDelegateAt(i); if (info_bar->AsTranslateInfoBarDelegate()) tab->RemoveInfoBar(info_bar); |