summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate/translate_infobar_delegate.h
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 06:51:15 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 06:51:15 +0000
commitc7e136fc8a564f1a30ef6214e4f2b5d598cfbe94 (patch)
tree147504d5e33aabc8c91d3be94ddec28f13eaead5 /chrome/browser/translate/translate_infobar_delegate.h
parentbd209fefecce23870a49ad6e848625f6eee7e66c (diff)
downloadchromium_src-c7e136fc8a564f1a30ef6214e4f2b5d598cfbe94.zip
chromium_src-c7e136fc8a564f1a30ef6214e4f2b5d598cfbe94.tar.gz
chromium_src-c7e136fc8a564f1a30ef6214e4f2b5d598cfbe94.tar.bz2
Hide translate infobar on programmatic navigation.
In Google news, you can change the UI language through a popup menu [which does so by submitting a form programmatically]. The translation infobar wasn't being refreshed in this situation because the page navigation being performed is programmatic. Infobar hiding on navigation, goes through TabContents::ExpireInfoBars() which has an early return if the navigation just performed wasn't initiated by the user. After this, the code loops through the list of infobars and calls ShouldExpire() on each one to determine if it can be closed. This CL removes the early return and moves the code to determine dismissal to the ShouldExpire() method of the infobar delegates, thus allowing the translate infobar to indicate that it can be dismissed on page navigation. BUG=70261 TEST=See bug. Review URL: http://codereview.chromium.org/6883299 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_infobar_delegate.h')
-rw-r--r--chrome/browser/translate/translate_infobar_delegate.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h
index 03c196e..4ba31e6 100644
--- a/chrome/browser/translate/translate_infobar_delegate.h
+++ b/chrome/browser/translate/translate_infobar_delegate.h
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
+#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/translate/translate_prefs.h"
#include "chrome/common/translate_errors.h"
@@ -163,6 +163,8 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
virtual void InfoBarDismissed() OVERRIDE;
virtual gfx::Image* GetIcon() const OVERRIDE;
virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE;
+ virtual bool ShouldExpire(
+ const NavigationController::LoadCommittedDetails& details) const;
virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE;
// Gets the host of the page being translated, or an empty string if no URL is