diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 07:26:32 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 07:26:32 +0000 |
commit | 192d8c5ea712cca42ea1d6ff692cd77d099c0a35 (patch) | |
tree | adc818cdd39ff402645f391f773bf359e7b753f0 /chrome/browser/tab_contents/language_state.h | |
parent | 781a7edbdb3288b237acbeff4926b47b243cef17 (diff) | |
download | chromium_src-192d8c5ea712cca42ea1d6ff692cd77d099c0a35.zip chromium_src-192d8c5ea712cca42ea1d6ff692cd77d099c0a35.tar.gz chromium_src-192d8c5ea712cca42ea1d6ff692cd77d099c0a35.tar.bz2 |
Make the translation bar not show up again when you closed it in a page
and navigate in page. This is the case with web apps like GMail where
many actions result in an in-page navigation. It would originally bring
back the translation infobar, which is very anoying.
This CL fixes the is_in_page state of LoadCommittedDetails, it was always false.
This triggered a bug in the SSLManager that was wrongly not setting the SSL states when an in-page navigation is performed.
Since we create a new navigation entry for in-page navigations, not setting these states would make a bad page being reported as OK after an in-page navigation.
See original review:
http://codereview.chromium.org/650146/show
BUG=36304
TEST=Login to gmail, change the GMail language to a language different than
the Chrome language. When a translate infobar shows up, close it.
Click on the different links in GMail (inbox, drafts, select email...)
the translate infobar should not show again.
Review URL: http://codereview.chromium.org/650207
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39700 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/language_state.h')
-rw-r--r-- | chrome/browser/tab_contents/language_state.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/language_state.h b/chrome/browser/tab_contents/language_state.h index 21dea9d..f428229 100644 --- a/chrome/browser/tab_contents/language_state.h +++ b/chrome/browser/tab_contents/language_state.h @@ -27,7 +27,7 @@ class LanguageState { // Should be called when the page did a new navigation (whether it is a main // frame or sub-frame navigation). - void DidNavigate(bool reload); + void DidNavigate(bool reload, bool in_page_navigation); // Should be called when the language of the page has been determined. void LanguageDetermined(const std::string& page_language); @@ -56,6 +56,10 @@ class LanguageState { bool translation_declined() const { return translation_declined_; } void set_translation_declined(bool value) { translation_declined_ = value; } + // Whether the current page was navigated through an in-page (fragment) + // navigation. + bool in_page_navigation() const { return in_page_navigation_; } + private: // The languages this page is in. Note that current_lang_ is different from // original_lang_ when the page has been translated. @@ -86,6 +90,9 @@ class LanguageState { // load happens in the page after the user closed the infobar. bool translation_declined_; + // Whether the current navigation is a fragment navigation (in page). + bool in_page_navigation_; + DISALLOW_COPY_AND_ASSIGN(LanguageState); }; |