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

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

Issue 2678053002: Convert ContentTranslateDriver to use the new navigation callbacks. (Closed)
Patch Set: Created 3 years, 10 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 | « components/translate/content/browser/content_translate_driver.h ('k') | 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 ed585f34763980a557a19181f39a3db5167b7689..fb7aec1b0976a9c541c6a81cb16b1579ac889863 100644
--- a/components/translate/content/browser/content_translate_driver.cc
+++ b/components/translate/content/browser/content_translate_driver.cc
@@ -15,6 +15,7 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
@@ -211,17 +212,18 @@ void ContentTranslateDriver::NavigationEntryCommitted(
0));
}
-void ContentTranslateDriver::DidNavigateAnyFrame(
- content::RenderFrameHost* render_frame_host,
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void ContentTranslateDriver::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->HasCommitted())
groby-ooo-7-16 2017/02/07 18:31:08 Why do we need to check HasCommitted()? Isn't that
jam 2017/02/07 18:35:17 If the response is a download or 204/205, then the
jam 2017/02/07 18:37:05 btw thanks for reminding me, I wanted to add some
+ return;
+
// Let the LanguageState clear its state.
const bool reload =
- ui::PageTransitionCoreTypeIs(details.entry->GetTransitionType(),
- ui::PAGE_TRANSITION_RELOAD) ||
- details.type == content::NAVIGATION_TYPE_SAME_PAGE;
+ navigation_handle->GetReloadType() != content::ReloadType::NONE ||
groby-ooo-7-16 2017/02/07 18:31:08 I assume ReloadType()!=NONE is the equivalent of P
jam 2017/02/07 18:35:17 Correct
+ navigation_handle->IsSamePage();
translate_manager_->GetLanguageState().DidNavigate(
- details.is_in_page, details.is_main_frame, reload);
+ navigation_handle->IsSamePage(), navigation_handle->IsInMainFrame(),
groby-ooo-7-16 2017/02/07 18:31:08 Should this pass through the |navigation_handle| i
jam 2017/02/07 18:35:17 That's calling out to shared code with ios, so it
+ reload);
}
void ContentTranslateDriver::OnPageAway(int page_seq_no) {
« no previous file with comments | « components/translate/content/browser/content_translate_driver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698