diff options
-rw-r--r-- | chrome/browser/autofill/autofill_manager.cc | 14 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.h | 7 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 9 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host_delegate.h | 5 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 7 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 25 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 5 |
8 files changed, 7 insertions, 67 deletions
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index bf0857d..23f9574 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -61,18 +61,6 @@ void AutoFillManager::FormFieldValuesSubmitted( } } -void AutoFillManager::FormsSeen( - const std::vector<webkit_glue::FormFieldValues>& forms) { - form_structures_.reset(); - for (std::vector<webkit_glue::FormFieldValues>::const_iterator iter = - forms.begin(); - iter != forms.end(); ++iter) { - FormStructure* form_structure = new FormStructure(*iter); - DeterminePossibleFieldTypes(form_structure); - form_structures_.push_back(form_structure); - } -} - void AutoFillManager::OnAutoFillDialogApply( std::vector<AutoFillProfile>* profiles, std::vector<CreditCard>* credit_cards) { @@ -114,7 +102,7 @@ void AutoFillManager::HandleSubmit() { // If there wasn't enough data to import then we don't want to send an upload // to the server. if (personal_data_ && - !personal_data_->ImportFormData(form_structures_.get(), this)) + !personal_data_->ImportFormData(form_structures_, this)) return; UploadFormData(); diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index 0c55853..85905c8 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -8,7 +8,6 @@ #include <vector> #include "base/scoped_ptr.h" -#include "base/scoped_vector.h" #include "chrome/browser/autofill/autofill_dialog.h" #include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" @@ -39,8 +38,6 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, // RenderViewHostDelegate::AutoFill implementation: virtual void FormFieldValuesSubmitted( const webkit_glue::FormFieldValues& form); - virtual void FormsSeen( - const std::vector<webkit_glue::FormFieldValues>& forms); // AutoFillDialogObserver implementation: virtual void OnAutoFillDialogApply( @@ -74,11 +71,11 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, TabContents* tab_contents_; // The personal data manager, used to save and load personal data to/from the - // web database. This may be NULL if we're OTR. + // web database. PersonalDataManager* personal_data_; // Our copy of the form data. - ScopedVector<FormStructure> form_structures_; + std::vector<FormStructure*> form_structures_; scoped_ptr<FormStructure> upload_form_structure_; // The infobar that asks for permission to store form information. diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 2c1bdf2..dd93494 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -757,7 +757,6 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { OnMsgRunBeforeUnloadConfirm) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog, OnMsgShowModalHTMLDialog) - IPC_MESSAGE_HANDLER(ViewHostMsg_FormsSeen, OnMsgFormsSeen) IPC_MESSAGE_HANDLER(ViewHostMsg_PasswordFormsSeen, OnMsgPasswordFormsSeen) IPC_MESSAGE_HANDLER(ViewHostMsg_FormFieldValuesSubmitted, OnMsgFormFieldValuesSubmitted) @@ -1343,14 +1342,6 @@ void RenderViewHost::MediaPlayerActionAt(const gfx::Point& location, Send(new ViewMsg_MediaPlayerActionAt(routing_id(), location, action)); } -void RenderViewHost::OnMsgFormsSeen( - const std::vector<webkit_glue::FormFieldValues>& forms) { - RenderViewHostDelegate::AutoFill* autofill_delegate = - delegate_->GetAutoFillDelegate(); - if (autofill_delegate) - autofill_delegate->FormsSeen(forms); -} - void RenderViewHost::OnMsgPasswordFormsSeen( const std::vector<webkit_glue::PasswordForm>& forms) { delegate_->PasswordFormsSeen(forms); diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 5e952d9..bf00762 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -535,8 +535,6 @@ class RenderViewHost : public RenderWidgetHost { void OnMsgShowModalHTMLDialog(const GURL& url, int width, int height, const std::string& json_arguments, IPC::Message* reply_msg); - void OnMsgFormsSeen( - const std::vector<webkit_glue::FormFieldValues>& forms); void OnMsgPasswordFormsSeen( const std::vector<webkit_glue::PasswordForm>& forms); void OnMsgFormFieldValuesSubmitted(const webkit_glue::FormFieldValues& forms); diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index 3dd7b9a..9756d78 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -390,11 +390,6 @@ class RenderViewHostDelegate { // Called when the user submits a form. virtual void FormFieldValuesSubmitted( const webkit_glue::FormFieldValues& form) = 0; - - // Called when the frame has finished loading and there are forms in the - // frame. - virtual void FormsSeen( - const std::vector<webkit_glue::FormFieldValues>& forms) = 0; }; // --------------------------------------------------------------------------- diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index b985c96..2efcc63 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -1341,13 +1341,8 @@ IPC_BEGIN_MESSAGES(ViewHost) string16 /* title */, FilePath /* Default file name */) - // Notification that forms have been seen that are candidates for - // filling/submitting by the AutoFillManager. - IPC_MESSAGE_ROUTED1(ViewHostMsg_FormsSeen, - std::vector<webkit_glue::FormFieldValues> /* forms */) - // Notification that password forms have been seen that are candidates for - // filling/submitting by the password manager. + // filling/submitting by the password manager IPC_MESSAGE_ROUTED1(ViewHostMsg_PasswordFormsSeen, std::vector<webkit_glue::PasswordForm> /* forms */) diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 6b54fe3..740c147 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2511,10 +2511,8 @@ void RenderView::didFinishDocumentLoad(WebFrame* frame) { Send(new ViewHostMsg_DocumentLoadedInFrame(routing_id_)); - // The document has now been fully loaded. Scan for forms to be sent up to - // the browser. - // TODO(jhawkins): Make these use the FormManager. - SendForms(frame); + // The document has now been fully loaded. Scan for password forms to be + // sent up to the browser. SendPasswordForms(frame); // Check whether we have new encoding name. @@ -4237,25 +4235,6 @@ void RenderView::focusAccessibilityObject( #endif } -void RenderView::SendForms(WebFrame* frame) { - WebVector<WebFormElement> web_forms; - frame->forms(web_forms); - - std::vector<FormFieldValues> forms; - for (size_t i = 0; i < web_forms.size(); ++i) { - const WebFormElement& web_form = web_forms[i]; - - if (web_form.autoComplete()) { - scoped_ptr<FormFieldValues> form(FormFieldValues::Create(web_form)); - if (form.get()) - forms.push_back(*form); - } - } - - if (!forms.empty()) - Send(new ViewHostMsg_FormsSeen(routing_id_, forms)); -} - void RenderView::SendPasswordForms(WebFrame* frame) { WebVector<WebFormElement> forms; frame->forms(forms); diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index ab59b72..0066bf3 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -803,10 +803,7 @@ class RenderView : public RenderWidget, void LogNavigationState(const NavigationState* state, const WebKit::WebDataSource* ds) const; - // Scans the given frame for forms and sends them up to the browser. - void SendForms(WebKit::WebFrame* frame); - - // Scans the given frame for password forms and sends them up to the browser. + // Scan the given frame for password forms and send them up to the browser. void SendPasswordForms(WebKit::WebFrame* frame); void Print(WebKit::WebFrame* frame, bool script_initiated); |