| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/translate/ios/browser/language_detection_controller.h" | 5 #include "components/translate/ios/browser/language_detection_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // web::WebStateObserver implementation: | 133 // web::WebStateObserver implementation: |
| 134 | 134 |
| 135 void LanguageDetectionController::PageLoaded( | 135 void LanguageDetectionController::PageLoaded( |
| 136 web::PageLoadCompletionStatus load_completion_status) { | 136 web::PageLoadCompletionStatus load_completion_status) { |
| 137 if (load_completion_status == web::PageLoadCompletionStatus::SUCCESS) | 137 if (load_completion_status == web::PageLoadCompletionStatus::SUCCESS) |
| 138 StartLanguageDetection(); | 138 StartLanguageDetection(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void LanguageDetectionController::DidFinishNavigation( | 141 void LanguageDetectionController::DidFinishNavigation( |
| 142 web::NavigationContext* navigation_context) { | 142 web::NavigationContext* navigation_context) { |
| 143 if (navigation_context->IsSamePage()) | 143 if (navigation_context->IsSameDocument()) |
| 144 StartLanguageDetection(); | 144 StartLanguageDetection(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void LanguageDetectionController::WebStateDestroyed() { | 147 void LanguageDetectionController::WebStateDestroyed() { |
| 148 web_state()->RemoveScriptCommandCallback(kCommandPrefix); | 148 web_state()->RemoveScriptCommandCallback(kCommandPrefix); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace translate | 151 } // namespace translate |
| OLD | NEW |