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

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

Issue 2019373002: Fix page transition qualifiers not masked out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added one more occurrence. Created 4 years, 7 months 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 | « chrome/browser/ui/webui/chrome_web_contents_handler.cc ('k') | content/test/test_render_frame_host.cc » ('j') | 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 87aaefe335e3fec9762dcf1af1b408a06855f2ce..91b9a736e1246a26d615ca3915a3651a7ba51aea 100644
--- a/components/translate/content/browser/content_translate_driver.cc
+++ b/components/translate/content/browser/content_translate_driver.cc
@@ -86,8 +86,10 @@ void ContentTranslateDriver::InitiateTranslation(const std::string& page_lang,
bool ContentTranslateDriver::IsLinkNavigation() {
return navigation_controller_ &&
navigation_controller_->GetLastCommittedEntry() &&
- navigation_controller_->GetLastCommittedEntry()->GetTransitionType() ==
- ui::PAGE_TRANSITION_LINK;
+ ui::PageTransitionCoreTypeIs(
+ navigation_controller_->GetLastCommittedEntry()
+ ->GetTransitionType(),
+ ui::PAGE_TRANSITION_LINK);
}
void ContentTranslateDriver::OnTranslateEnabledChanged() {
@@ -179,7 +181,8 @@ void ContentTranslateDriver::NavigationEntryCommitted(
}
// If not a reload, return.
- if (entry->GetTransitionType() != ui::PAGE_TRANSITION_RELOAD &&
+ if (!ui::PageTransitionCoreTypeIs(entry->GetTransitionType(),
+ ui::PAGE_TRANSITION_RELOAD) &&
load_details.type != content::NAVIGATION_TYPE_SAME_PAGE) {
return;
}
@@ -205,7 +208,8 @@ void ContentTranslateDriver::DidNavigateAnyFrame(
const content::FrameNavigateParams& params) {
// Let the LanguageState clear its state.
const bool reload =
- details.entry->GetTransitionType() == ui::PAGE_TRANSITION_RELOAD ||
+ ui::PageTransitionCoreTypeIs(details.entry->GetTransitionType(),
+ ui::PAGE_TRANSITION_RELOAD) ||
details.type == content::NAVIGATION_TYPE_SAME_PAGE;
translate_manager_->GetLanguageState().DidNavigate(
details.is_in_page, details.is_main_frame, reload);
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_contents_handler.cc ('k') | content/test/test_render_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698