summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 18:46:56 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 18:46:56 +0000
commit575c4e175880c7ba333e2d734dc7bb5a73b10f3b (patch)
tree4cdba0a726af43633becbbf887c75cdacb2c514a /chrome/browser/tab_contents
parent65ec1925d1669521e60528fa8f976694565bcef7 (diff)
downloadchromium_src-575c4e175880c7ba333e2d734dc7bb5a73b10f3b.zip
chromium_src-575c4e175880c7ba333e2d734dc7bb5a73b10f3b.tar.gz
chromium_src-575c4e175880c7ba333e2d734dc7bb5a73b10f3b.tar.bz2
Reloading a page would not show a translate infobar.
This CL fixes that bug. BUG=35602, 35482 TEST=Navigate to a page in a foreign language. The tranlate infobar is shown. Reload the page, the infobar should be shown again. Review URL: http://codereview.chromium.org/597065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/language_state.cc10
-rw-r--r--chrome/browser/tab_contents/language_state.h2
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc3
3 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/tab_contents/language_state.cc b/chrome/browser/tab_contents/language_state.cc
index 8522ed3..87fe217 100644
--- a/chrome/browser/tab_contents/language_state.cc
+++ b/chrome/browser/tab_contents/language_state.cc
@@ -15,11 +15,13 @@ LanguageState::LanguageState(NavigationController* nav_controller)
LanguageState::~LanguageState() {
}
-void LanguageState::DidNavigate() {
- prev_original_lang_ = original_lang_;
- prev_current_lang_ = current_lang_;
+void LanguageState::DidNavigate(bool reload) {
+ if (!reload) {
+ prev_original_lang_ = original_lang_;
+ prev_current_lang_ = current_lang_;
+ original_lang_.clear();
+ }
- original_lang_.clear();
current_lang_.clear();
translation_pending_ = false;
diff --git a/chrome/browser/tab_contents/language_state.h b/chrome/browser/tab_contents/language_state.h
index d5c7df6..f8b2a68 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();
+ void DidNavigate(bool reload);
// Should be called when the language of the page has been determined.
void LanguageDetermined(const std::string& page_language);
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index ed15084..9d3ab59 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1507,7 +1507,8 @@ void TabContents::DidNavigateAnyFramePostCommit(
GetPasswordManager()->ProvisionallySavePassword(params.password_form);
// Let the LanguageState clear its state.
- language_state_.DidNavigate();
+ language_state_.DidNavigate(details.entry->transition_type() ==
+ PageTransition::RELOAD);
}
void TabContents::CloseConstrainedWindows() {