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

Unified Diff: components/autofill/core/browser/autofill_handler.cc

Issue 2745803003: autofill-try
Patch Set: autofill-try Created 3 years, 7 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: components/autofill/core/browser/autofill_handler.cc
diff --git a/components/autofill/core/browser/autofill_handler.cc b/components/autofill/core/browser/autofill_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f0328d633685084b4a268990f25bbbc0e7dab105
--- /dev/null
+++ b/components/autofill/core/browser/autofill_handler.cc
@@ -0,0 +1,55 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/autofill/core/browser/autofill_handler.h"
+
+#include "components/autofill/core/common/autofill_data_validation.h"
+#include "ui/gfx/geometry/rect_f.h"
+
+namespace autofill {
+
+using base::TimeTicks;
+
+AutofillHandler::AutofillHandler(AutofillDriver* driver) : driver_(driver) {}
+
+AutofillHandler::~AutofillHandler() {}
+
+bool AutofillHandler::OnWillSubmitForm(const FormData& form,
+ const TimeTicks timestamp) {
+ if (!IsValidFormData(form))
+ return false;
+
+ return OnWillSubmitFormImpl(form, timestamp);
+}
+
+void AutofillHandler::OnTextFieldDidChange(const FormData& form,
+ const FormFieldData& field,
+ const TimeTicks timestamp) {
+ if (!IsValidFormData(form) || !IsValidFormFieldData(field))
+ return;
+
+ OnTextFieldDidChangeImpl(form, field, timestamp);
+}
+
+void AutofillHandler::OnQueryFormFieldAutofill(int query_id,
+ const FormData& form,
+ const FormFieldData& field,
+ const gfx::RectF& bounding_box) {
+ if (!IsValidFormData(form) || !IsValidFormFieldData(field))
+ return;
+
+ gfx::RectF transformed_box =
+ driver_->TransformBoundingBoxToViewportCoordinates(bounding_box);
+
+ OnQueryFormFieldAutofillImpl(query_id, form, field, transformed_box);
+}
+
+void AutofillHandler::SendFormDataToRenderer(
+ int query_id,
+ AutofillDriver::RendererFormDataAction action,
+ const FormData& data) {
+ driver_->SendFormDataToRenderer(query_id, action, data);
+}
+
+} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autofill_handler.h ('k') | components/autofill/core/browser/autofill_handler_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698