Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: components/translate/content/browser/content_translate_driver.cc

Issue 2533473003: Forbid content translate driver from initiating translation for page forward/back. (Closed)
Patch Set: Block PAGE_TRANSITION_FORWARD_BACK specifically Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/content/browser/content_translate_driver.cc
diff --git a/components/translate/content/browser/content_translate_driver.cc b/components/translate/content/browser/content_translate_driver.cc
index 54a862d50326738eb215d07460a05097fdaf6a0e..ed585f34763980a557a19181f39a3db5167b7689 100644
--- a/components/translate/content/browser/content_translate_driver.cc
+++ b/components/translate/content/browser/content_translate_driver.cc
@@ -189,6 +189,13 @@ void ContentTranslateDriver::NavigationEntryCommitted(
return;
}
+ if (entry->GetTransitionType() & ui::PAGE_TRANSITION_FORWARD_BACK) {
+ // Workaround for http://crbug.com/653051: back navigation sometimes have
+ // the reload core type. Once http://crbug.com/669008 got resolved, we
+ // could revisit here for a thorough solution.
+ return;
+ }
+
if (!translate_manager_->GetLanguageState().page_needs_translation())
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698