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

Unified Diff: components/autofill/content/browser/content_autofill_driver.cc

Issue 2606473003: Use AutofillDriver* in ContentAutofillDriverFactory when possible (Closed)
Patch Set: Fix Android compilation Created 4 years 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: components/autofill/content/browser/content_autofill_driver.cc
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc
index 2449d6c69d0911e6e357dbeaad10f209b1347bc9..cb04137cf94e50d099b5216fa887fe50b4d6fd1b 100644
--- a/components/autofill/content/browser/content_autofill_driver.cc
+++ b/components/autofill/content/browser/content_autofill_driver.cc
@@ -17,7 +17,6 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_details.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -53,7 +52,9 @@ ContentAutofillDriver* ContentAutofillDriver::GetForRenderFrameHost(
ContentAutofillDriverFactory* factory =
ContentAutofillDriverFactory::FromWebContents(
content::WebContents::FromRenderFrameHost(render_frame_host));
- return factory ? factory->DriverForFrame(render_frame_host) : nullptr;
+ return factory ? static_cast<ContentAutofillDriver*>(
+ factory->DriverForFrame(render_frame_host))
+ : nullptr;
}
void ContentAutofillDriver::BindRequest(mojom::AutofillDriverRequest request) {
@@ -179,6 +180,10 @@ void ContentAutofillDriver::DidInteractWithCreditCardForm() {
contents->OnCreditCardInputShownOnHttp();
}
+void ContentAutofillDriver::NavigatedToDifferentPage() {
+ autofill_manager_->Reset();
+}
+
// mojom::AutofillDriver:
void ContentAutofillDriver::FirstUserGestureObserved() {
client_->OnFirstUserGestureObserved();
@@ -239,13 +244,6 @@ void ContentAutofillDriver::SetDataList(
autofill_manager_->OnSetDataList(values, labels);
}
-void ContentAutofillDriver::DidNavigateFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- if (details.is_navigation_to_different_page())
- autofill_manager_->Reset();
-}
-
void ContentAutofillDriver::SetAutofillManager(
std::unique_ptr<AutofillManager> manager) {
autofill_manager_ = std::move(manager);

Powered by Google App Engine
This is Rietveld 408576698