Commit 8e244431 authored by Michael Bai's avatar Michael Bai Committed by Commit Bot

Autofill: Move AutofillDownloadManager::Observer to AutofillHandler

This patch moves AutofillDownloadManager::Observer to AutofillHandlder
No function change.

Bug: 1151542
Change-Id: I7a290f72d4b51d9362c9cdec44ab74f4ae443a9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2553185Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: Michael Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831195}
parent c3fa6817
...@@ -315,4 +315,13 @@ void AutofillHandler::Reset() { ...@@ -315,4 +315,13 @@ void AutofillHandler::Reset() {
form_structures_.clear(); form_structures_.clear();
} }
void AutofillHandler::OnLoadedServerPredictions(
std::string response,
const std::vector<FormSignature>& queried_form_signatures) {}
void AutofillHandler::OnServerRequestError(
FormSignature form_signature,
AutofillDownloadManager::RequestType request_type,
int http_error) {}
} // namespace autofill } // namespace autofill
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/autofill/core/browser/autofill_download_manager.h"
#include "components/autofill/core/browser/autofill_driver.h" #include "components/autofill/core/browser/autofill_driver.h"
#include "components/autofill/core/common/form_data.h" #include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/language_code.h" #include "components/autofill/core/common/language_code.h"
...@@ -34,7 +35,7 @@ class LogManager; ...@@ -34,7 +35,7 @@ class LogManager;
// This class defines the interface should be implemented by autofill // This class defines the interface should be implemented by autofill
// implementation in browser side to interact with AutofillDriver. // implementation in browser side to interact with AutofillDriver.
class AutofillHandler { class AutofillHandler : public AutofillDownloadManager::Observer {
public: public:
enum AutofillDownloadManagerState { enum AutofillDownloadManagerState {
ENABLE_AUTOFILL_DOWNLOAD_MANAGER, ENABLE_AUTOFILL_DOWNLOAD_MANAGER,
...@@ -48,7 +49,7 @@ class AutofillHandler { ...@@ -48,7 +49,7 @@ class AutofillHandler {
virtual void OnFormParsed() = 0; virtual void OnFormParsed() = 0;
}; };
virtual ~AutofillHandler(); ~AutofillHandler() override;
// Invoked when the value of textfield is changed. // Invoked when the value of textfield is changed.
void OnTextFieldDidChange(const FormData& form, void OnTextFieldDidChange(const FormData& form,
...@@ -224,6 +225,14 @@ class AutofillHandler { ...@@ -224,6 +225,14 @@ class AutofillHandler {
} }
private: private:
// AutofillDownloadManager::Observer:
void OnLoadedServerPredictions(
std::string response,
const std::vector<FormSignature>& queried_form_signatures) override;
void OnServerRequestError(FormSignature form_signature,
AutofillDownloadManager::RequestType request_type,
int http_error) override;
// Provides driver-level context to the shared code of the component. Must // Provides driver-level context to the shared code of the component. Must
// outlive this object. // outlive this object.
AutofillDriver* const driver_; AutofillDriver* const driver_;
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "components/autofill/core/browser/autocomplete_history_manager.h" #include "components/autofill/core/browser/autocomplete_history_manager.h"
#include "components/autofill/core/browser/autofill_client.h" #include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/autofill_download_manager.h"
#include "components/autofill/core/browser/autofill_driver.h" #include "components/autofill/core/browser/autofill_driver.h"
#include "components/autofill/core/browser/autofill_handler.h" #include "components/autofill/core/browser/autofill_handler.h"
#include "components/autofill/core/browser/autofill_metrics.h" #include "components/autofill/core/browser/autofill_metrics.h"
...@@ -78,7 +77,6 @@ enum class ValuePatternsMetric { ...@@ -78,7 +77,6 @@ enum class ValuePatternsMetric {
// Manages saving and restoring the user's personal information entered into web // Manages saving and restoring the user's personal information entered into web
// forms. One per frame; owned by the AutofillDriver. // forms. One per frame; owned by the AutofillDriver.
class AutofillManager : public AutofillHandler, class AutofillManager : public AutofillHandler,
public AutofillDownloadManager::Observer,
public AutocompleteHistoryManager::SuggestionsHandler, public AutocompleteHistoryManager::SuggestionsHandler,
public CreditCardAccessManager::Accessor { public CreditCardAccessManager::Accessor {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment