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 { ...@@ -328,7 +328,7 @@ bool ChromeTranslateClient::IsAutofillAssistantRunning() const {
void ChromeTranslateClient::OnStateChanged(autofill_assistant::UIState state) { void ChromeTranslateClient::OnStateChanged(autofill_assistant::UIState state) {
if (state == autofill_assistant::UIState::kNotShown) { if (state == autofill_assistant::UIState::kNotShown) {
GetTranslateManager()->InitiateTranslation(); GetTranslateManager()->OnAutofillAssistantFinished();
} }
} }
......
...@@ -177,7 +177,7 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) { ...@@ -177,7 +177,7 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) {
target_lang); target_lang);
} }
void TranslateManager::InitiateTranslation() { void TranslateManager::OnAutofillAssistantFinished() {
if (!page_language_code_.empty()) { if (!page_language_code_.empty()) {
InitiateTranslation(page_language_code_); InitiateTranslation(page_language_code_);
} }
......
...@@ -124,9 +124,8 @@ class TranslateManager { ...@@ -124,9 +124,8 @@ class TranslateManager {
// Starts the translation process for the page in the |page_lang| language. // Starts the translation process for the page in the |page_lang| language.
void InitiateTranslation(const std::string& page_lang); void InitiateTranslation(const std::string& page_lang);
// Starts the translation process for the page in the |page_language_code| // Maybe initiates translation when Autofill Assistant has finished.
// language. void OnAutofillAssistantFinished();
void InitiateTranslation();
// Initiate a manually triggered translation process for the current page. // Initiate a manually triggered translation process for the current page.
// Collect source and target languages, and show translation UI. If // Collect source and target languages, and show translation UI. If
...@@ -331,9 +330,9 @@ class TranslateManager { ...@@ -331,9 +330,9 @@ class TranslateManager {
std::unique_ptr<metrics::TranslateEventProto> translate_event_; std::unique_ptr<metrics::TranslateEventProto> translate_event_;
// Language code of current page. Code is remember when translation is // Language code of current page. Code is stored when translation is disabled
// disabled by Autofill Assistant. This code is later used to translate page // by Autofill Assistant. This code is later used to translate page when
// when Autofill Assistant finishes run. // Autofill Assistant finishes run.
std::string page_language_code_; std::string page_language_code_;
base::WeakPtrFactory<TranslateManager> weak_method_factory_{this}; 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