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

Side by Side Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 854943002: Remove RenderViewObserver::Resized (try 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test compile Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/content/renderer/autofill_agent.h" 5 #include "components/autofill/content/renderer/autofill_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 IPC_MESSAGE_HANDLER(AutofillMsg_ClearPreviewedForm, OnClearPreviewedForm) 165 IPC_MESSAGE_HANDLER(AutofillMsg_ClearPreviewedForm, OnClearPreviewedForm)
166 IPC_MESSAGE_HANDLER(AutofillMsg_FillFieldWithValue, OnFillFieldWithValue) 166 IPC_MESSAGE_HANDLER(AutofillMsg_FillFieldWithValue, OnFillFieldWithValue)
167 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewFieldWithValue, 167 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewFieldWithValue,
168 OnPreviewFieldWithValue) 168 OnPreviewFieldWithValue)
169 IPC_MESSAGE_HANDLER(AutofillMsg_AcceptDataListSuggestion, 169 IPC_MESSAGE_HANDLER(AutofillMsg_AcceptDataListSuggestion,
170 OnAcceptDataListSuggestion) 170 OnAcceptDataListSuggestion)
171 IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordSuggestion, 171 IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordSuggestion,
172 OnFillPasswordSuggestion) 172 OnFillPasswordSuggestion)
173 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordSuggestion, 173 IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordSuggestion,
174 OnPreviewPasswordSuggestion) 174 OnPreviewPasswordSuggestion)
175 IPC_MESSAGE_HANDLER(AutofillMsg_PopupHidden, OnPopupHidden)
175 IPC_MESSAGE_HANDLER(AutofillMsg_RequestAutocompleteResult, 176 IPC_MESSAGE_HANDLER(AutofillMsg_RequestAutocompleteResult,
176 OnRequestAutocompleteResult) 177 OnRequestAutocompleteResult)
177 IPC_MESSAGE_UNHANDLED(handled = false) 178 IPC_MESSAGE_UNHANDLED(handled = false)
178 IPC_END_MESSAGE_MAP() 179 IPC_END_MESSAGE_MAP()
179 return handled; 180 return handled;
180 } 181 }
181 182
182 void AutofillAgent::DidCommitProvisionalLoad(bool is_new_navigation) { 183 void AutofillAgent::DidCommitProvisionalLoad(bool is_new_navigation) {
183 form_cache_.Reset(); 184 form_cache_.Reset();
184 } 185 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 228
228 const WebInputElement* element = toWebInputElement(&web_element); 229 const WebInputElement* element = toWebInputElement(&web_element);
229 230
230 if (!element || !element->isEnabled() || element->isReadOnly() || 231 if (!element || !element->isEnabled() || element->isReadOnly() ||
231 !element->isTextField() || element->isPasswordField()) 232 !element->isTextField() || element->isPasswordField())
232 return; 233 return;
233 234
234 element_ = *element; 235 element_ = *element;
235 } 236 }
236 237
237 void AutofillAgent::Resized() {
238 HidePopup();
239 }
240
241 void AutofillAgent::didRequestAutocomplete( 238 void AutofillAgent::didRequestAutocomplete(
242 const WebFormElement& form) { 239 const WebFormElement& form) {
243 DCHECK_EQ(form.document().frame(), render_frame()->GetWebFrame()); 240 DCHECK_EQ(form.document().frame(), render_frame()->GetWebFrame());
244 241
245 // Disallow the dialog over non-https or broken https, except when the 242 // Disallow the dialog over non-https or broken https, except when the
246 // ignore SSL flag is passed. See http://crbug.com/272512. 243 // ignore SSL flag is passed. See http://crbug.com/272512.
247 // TODO(palmer): this should be moved to the browser process after frames 244 // TODO(palmer): this should be moved to the browser process after frames
248 // get their own processes. 245 // get their own processes.
249 GURL url(form.document().url()); 246 GURL url(form.document().url());
250 content::SSLStatus ssl_status = 247 content::SSLStatus ssl_status =
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 void AutofillAgent::OnPreviewPasswordSuggestion( 540 void AutofillAgent::OnPreviewPasswordSuggestion(
544 const base::string16& username, 541 const base::string16& username,
545 const base::string16& password) { 542 const base::string16& password) {
546 bool handled = password_autofill_agent_->PreviewSuggestion( 543 bool handled = password_autofill_agent_->PreviewSuggestion(
547 element_, 544 element_,
548 username, 545 username,
549 password); 546 password);
550 DCHECK(handled); 547 DCHECK(handled);
551 } 548 }
552 549
550 void AutofillAgent::OnPopupHidden() {
551 if (!element_.isNull())
552 OnClearPreviewedForm();
553 }
554
553 void AutofillAgent::OnRequestAutocompleteResult( 555 void AutofillAgent::OnRequestAutocompleteResult(
554 WebFormElement::AutocompleteResult result, 556 WebFormElement::AutocompleteResult result,
555 const base::string16& message, 557 const base::string16& message,
556 const FormData& form_data) { 558 const FormData& form_data) {
557 if (in_flight_request_form_.isNull()) 559 if (in_flight_request_form_.isNull())
558 return; 560 return;
559 561
560 if (result == WebFormElement::AutocompleteResultSuccess) { 562 if (result == WebFormElement::AutocompleteResultSuccess) {
561 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_); 563 FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_);
562 if (!in_flight_request_form_.checkValidity()) 564 if (!in_flight_request_form_.checkValidity())
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 // Always communicate to browser process for topmost frame. 735 // Always communicate to browser process for topmost frame.
734 if (!forms.empty() || !frame->parent()) { 736 if (!forms.empty() || !frame->parent()) {
735 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms, 737 Send(new AutofillHostMsg_FormsSeen(routing_id(), forms,
736 forms_seen_timestamp)); 738 forms_seen_timestamp));
737 } 739 }
738 } 740 }
739 741
740 void AutofillAgent::HidePopup() { 742 void AutofillAgent::HidePopup() {
741 if (!is_popup_possibly_visible_) 743 if (!is_popup_possibly_visible_)
742 return; 744 return;
743
744 if (!element_.isNull())
745 OnClearPreviewedForm();
746
747 is_popup_possibly_visible_ = false; 745 is_popup_possibly_visible_ = false;
748 Send(new AutofillHostMsg_HidePopup(routing_id())); 746 Send(new AutofillHostMsg_HidePopup(routing_id()));
749 } 747 }
750 748
751 void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) { 749 void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) {
752 for (size_t i = 0; i < nodes.size(); ++i) { 750 for (size_t i = 0; i < nodes.size(); ++i) {
753 WebLocalFrame* frame = nodes[i].document().frame(); 751 WebLocalFrame* frame = nodes[i].document().frame();
754 // Only monitors dynamic forms created in the top frame. Dynamic forms 752 // Only monitors dynamic forms created in the top frame. Dynamic forms
755 // inserted in iframes are not captured yet. Frame is only processed 753 // inserted in iframes are not captured yet. Frame is only processed
756 // if it has finished loading, otherwise you can end up with a partially 754 // if it has finished loading, otherwise you can end up with a partially
(...skipping 21 matching lines...) Expand all
778 776
779 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { 777 void AutofillAgent::LegacyAutofillAgent::OnDestruct() {
780 // No-op. Don't delete |this|. 778 // No-op. Don't delete |this|.
781 } 779 }
782 780
783 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged( 781 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged(
784 const WebNode& node) { 782 const WebNode& node) {
785 agent_->FocusedNodeChanged(node); 783 agent_->FocusedNodeChanged(node);
786 } 784 }
787 785
788 void AutofillAgent::LegacyAutofillAgent::Resized() {
789 agent_->Resized();
790 }
791
792 } // namespace autofill 786 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.h ('k') | components/autofill/core/browser/autofill_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698