Commit 8118daf7 authored by Maxim Kolosovskiy's avatar Maxim Kolosovskiy Committed by Commit Bot

[Translate] Rename InitiateTranslation to OnAutofillAssistantFinished

This CL is a follow-up of https://chromium-review.googlesource.com/c/chromium/src/+/2453289

Bug: 1133783
Change-Id: Icff794b1c644d311a7fa9f16248ee9a4f714da08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463823
Commit-Queue: Maxim Kolosovskiy  <kolos@chromium.org>
Auto-Submit: Maxim Kolosovskiy  <kolos@chromium.org>
Reviewed-by: default avatarMegan Jablonski <megjablon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816546}
parent d932ff52
......@@ -328,7 +328,7 @@ bool ChromeTranslateClient::IsAutofillAssistantRunning() const {
void ChromeTranslateClient::OnStateChanged(autofill_assistant::UIState state) {
if (state == autofill_assistant::UIState::kNotShown) {
GetTranslateManager()->InitiateTranslation();
GetTranslateManager()->OnAutofillAssistantFinished();
}
}
......
......@@ -177,7 +177,7 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) {
target_lang);
}
void TranslateManager::InitiateTranslation() {
void TranslateManager::OnAutofillAssistantFinished() {
if (!page_language_code_.empty()) {
InitiateTranslation(page_language_code_);
}
......
......@@ -124,9 +124,8 @@ class TranslateManager {
// Starts the translation process for the page in the |page_lang| language.
void InitiateTranslation(const std::string& page_lang);
// Starts the translation process for the page in the |page_language_code|
// language.
void InitiateTranslation();
// Maybe initiates translation when Autofill Assistant has finished.
void OnAutofillAssistantFinished();
// Initiate a manually triggered translation process for the current page.
// Collect source and target languages, and show translation UI. If
......@@ -331,9 +330,9 @@ class TranslateManager {
std::unique_ptr<metrics::TranslateEventProto> translate_event_;
// Language code of current page. Code is remember when translation is
// disabled by Autofill Assistant. This code is later used to translate page
// when Autofill Assistant finishes run.
// Language code of current page. Code is stored when translation is disabled
// by Autofill Assistant. This code is later used to translate page when
// Autofill Assistant finishes run.
std::string page_language_code_;
base::WeakPtrFactory<TranslateManager> weak_method_factory_{this};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment