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, |