From 403415accf228400fc1365d5de9696348509beb8 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Mon, 10 Jan 2011 18:57:53 +0000 Subject: Make RenderViewHost not know about AutoFill and AutoComplete. This only takes care of the browser side portion, the renderer change will be done separately once the WebKit change it depends on is rolled. Review URL: http://codereview.chromium.org/5958021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70914 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/translate/translate_manager.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/browser/translate') diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 84b576e..40fbae6 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -11,6 +11,7 @@ #include "base/singleton.h" #include "base/string_split.h" #include "base/string_util.h" +#include "chrome/browser/autofill/autofill_manager.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/pref_service.h" @@ -510,6 +511,12 @@ void TranslateManager::DoTranslatePage(TabContents* tab, tab->language_state().set_translation_pending(true); tab->render_view_host()->TranslatePage(entry->page_id(), translate_script, source_lang, target_lang); + + // Ideally we'd have a better way to uniquely identify form control elements, + // but we don't have that yet. So before start translation, we clear the + // current form and re-parse it in AutoFillManager first to get the new + // labels. + tab->autofill_manager()->Reset(); } void TranslateManager::PageTranslated(TabContents* tab, -- cgit v1.1