summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/language_state.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 21:06:36 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 21:06:36 +0000
commitf4da95ff623ea7b7b4bd2c6fe2402437a712b9df (patch)
tree20b3110d52e76a1bd04eb4b2eb6a18871588656a /chrome/browser/tab_contents/language_state.h
parente9e079909c486a3d7561c1a0433762b395c0f48d (diff)
downloadchromium_src-f4da95ff623ea7b7b4bd2c6fe2402437a712b9df.zip
chromium_src-f4da95ff623ea7b7b4bd2c6fe2402437a712b9df.tar.gz
chromium_src-f4da95ff623ea7b7b4bd2c6fe2402437a712b9df.tar.bz2
Makes sure we don't display several times the translate infobar for a page.
We can get several PAGE_DETERMINED notifications for one page. The user might have closed the translate infobar between these multiple notifications. This CL ensures we don't show the infobar again in such cases. BUG=35919 TEST=See bug. Review URL: http://codereview.chromium.org/613002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/language_state.h')
-rw-r--r--chrome/browser/tab_contents/language_state.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/language_state.h b/chrome/browser/tab_contents/language_state.h
index f8b2a68..21dea9d 100644
--- a/chrome/browser/tab_contents/language_state.h
+++ b/chrome/browser/tab_contents/language_state.h
@@ -52,6 +52,10 @@ class LanguageState {
bool translation_pending() const { return translation_pending_; }
void set_translation_pending(bool value) { translation_pending_ = value; }
+ // Whether the user has already declined to translate the page.
+ bool translation_declined() const { return translation_declined_; }
+ void set_translation_declined(bool value) { translation_declined_ = value; }
+
private:
// The languages this page is in. Note that current_lang_ is different from
// original_lang_ when the page has been translated.
@@ -77,6 +81,11 @@ class LanguageState {
// then we can get rid of that state.
bool translation_pending_;
+ // Whether the user has declined to translate the page (by closing the infobar
+ // for example). This is necessary as a new infobar could be shown if a new
+ // load happens in the page after the user closed the infobar.
+ bool translation_declined_;
+
DISALLOW_COPY_AND_ASSIGN(LanguageState);
};