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

Unified Diff: chrome/browser/autofill/autofill_manager.cc

Issue 9600038: Add Password Autofill Manager to New Autofill (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing up FindLoginInfo Created 8 years, 9 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: chrome/browser/autofill/autofill_manager.cc
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 5b475a1f535c94ec8e0734cae78a06aa2251c5a0..70da3bfffa1e6bdd4ec6e9f5574f3b1884a5d12a 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -58,6 +58,7 @@
#include "webkit/forms/form_data.h"
#include "webkit/forms/form_data_predictions.h"
#include "webkit/forms/form_field.h"
+#include "webkit/forms/password_form_dom_manager.h"
using base::TimeTicks;
using content::BrowserThread;
@@ -220,6 +221,10 @@ void AutofillManager::DidNavigateMainFrame(
Reset();
}
+bool AutofillManager::HasExternalDelegate() {
+ return external_delegate_ != NULL;
+}
+
bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AutofillManager, message)
@@ -245,6 +250,10 @@ bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
OnHideAutofillPopup)
IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup,
OnShowPasswordGenerationPopup)
+ IPC_MESSAGE_HANDLER(AutofillHostMsg_AddPasswordFormMapping,
+ OnAddPasswordFormMapping)
+ IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordSuggestions,
+ OnShowPasswordSuggestions)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -632,6 +641,22 @@ void AutofillManager::OnShowPasswordGenerationPopup(const gfx::Rect& bounds) {
#endif // #if defined(OS_ANDROID)
}
+void AutofillManager::OnAddPasswordFormMapping(
+ const webkit::forms::FormField& form,
+ const webkit::forms::PasswordFormFillData& fill_data) {
+ if (external_delegate_)
+ external_delegate_->AddPasswordFormMapping(form, fill_data);
+}
+
+void AutofillManager::OnShowPasswordSuggestions(
+ const webkit::forms::FormField& field,
+ const gfx::Rect& bounds,
+ const std::vector<string16>& suggestions) {
+ if (external_delegate_) {
+ external_delegate_->OnShowPasswordSuggestions(suggestions, field, bounds);
+ }
Ilya Sherman 2012/04/02 22:07:29 nit: No need for curly braces.
csharp 2012/04/03 12:25:55 Done.
+}
+
void AutofillManager::OnLoadedServerPredictions(
const std::string& response_xml) {
// Parse and store the server predictions.
@@ -740,6 +765,9 @@ void AutofillManager::Reset() {
user_did_edit_autofilled_field_ = false;
forms_loaded_timestamp_ = TimeTicks();
initial_interaction_timestamp_ = TimeTicks();
+
+ if (external_delegate_)
+ external_delegate_->Reset();
}
AutofillManager::AutofillManager(TabContentsWrapper* tab_contents,

Powered by Google App Engine
This is Rietveld 408576698