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

Unified Diff: components/translate/ios/browser/language_detection_controller.mm

Issue 2711363003: Use DidFinishNavigation callback in LanguageDetectionController. (Closed)
Patch Set: Removed unused method 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
Index: components/translate/ios/browser/language_detection_controller.mm
diff --git a/components/translate/ios/browser/language_detection_controller.mm b/components/translate/ios/browser/language_detection_controller.mm
index 42922618e9b2f713afe4f2fa44e60f04adbb9b23..53fda593ac110e41e0598d2e511b2b323a19d5d9 100644
--- a/components/translate/ios/browser/language_detection_controller.mm
+++ b/components/translate/ios/browser/language_detection_controller.mm
@@ -16,6 +16,7 @@
#import "components/translate/ios/browser/js_language_detection_manager.h"
#include "components/translate/ios/browser/string_clipping_util.h"
#import "ios/web/public/url_scheme_util.h"
+#include "ios/web/public/web_state/navigation_context.h"
#include "ios/web/public/web_state/web_state.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -137,12 +138,10 @@ void LanguageDetectionController::PageLoaded(
StartLanguageDetection();
}
-void LanguageDetectionController::UrlHashChanged() {
- StartLanguageDetection();
-}
-
-void LanguageDetectionController::HistoryStateChanged() {
- StartLanguageDetection();
+void LanguageDetectionController::DidFinishNavigation(
+ web::NavigationContext* navigation_context) {
+ if (navigation_context->IsSamePage())
+ StartLanguageDetection();
}
void LanguageDetectionController::WebStateDestroyed() {

Powered by Google App Engine
This is Rietveld 408576698