Commit efee597e authored by Ben Blake's avatar Ben Blake Committed by Commit Bot

Create new AutofillOfferManager class.

This change will introduce the interface for a new AutofillOfferManager
class. The AutofillOfferManager will be responsible for retrieving offer
data via the payments client; it will do this through GetOfferData() and
the subsequent callback function OnDidGetOfferData(). This change will
be followed by another change to implement the interface and connect the
AutofillOfferManager to both the AutofillManager and the payments client.

Change-Id: I3d8824123330696f88c07d9729892a2c1d006a6e
Bug: 1093057
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248219
Commit-Queue: Ben Blake <fiorito@google.com>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Reviewed-by: default avatarSiyu An <siyua@chromium.org>
Reviewed-by: default avatarAnne Lim <annelim@google.com>
Cr-Commit-Position: refs/heads/master@{#782772}
parent dc4c2a66
...@@ -169,6 +169,8 @@ jumbo_static_library("browser") { ...@@ -169,6 +169,8 @@ jumbo_static_library("browser") {
"metrics/form_event_logger_base.h", "metrics/form_event_logger_base.h",
"metrics/form_events.h", "metrics/form_events.h",
"payments/account_info_getter.h", "payments/account_info_getter.h",
"payments/autofill_offer_manager.cc",
"payments/autofill_offer_manager.h",
"payments/autofill_wallet_model_type_controller.cc", "payments/autofill_wallet_model_type_controller.cc",
"payments/autofill_wallet_model_type_controller.h", "payments/autofill_wallet_model_type_controller.h",
"payments/card_unmask_delegate.cc", "payments/card_unmask_delegate.cc",
......
// Copyright 2020 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/payments/autofill_offer_manager.h"
namespace autofill {
AutofillOfferManager::AutofillOfferManager() = default;
AutofillOfferManager::~AutofillOfferManager() = default;
} // namespace autofill
\ No newline at end of file
// Copyright 2020 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.
#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_AUTOFILL_OFFER_MANAGER_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_AUTOFILL_OFFER_MANAGER_H_
#include <string>
#include <vector>
#include "base/strings/string16.h"
namespace autofill {
struct AutofillOfferData {
AutofillOfferData();
~AutofillOfferData();
// The description of this offer.
base::string16 description;
// The name of this offer.
base::string16 name;
// The unique server id of this offer.
std::string offer_id;
// The ids of the cards this offer can be applied to.
std::vector<std::string> eligible_card_id;
// The merchant URL where this offer can be redeemed.
std::vector<std::string> merchant_domain;
};
// Manages all Autofill related offers. One per frame; owned by the
// AutofillManager.
class AutofillOfferManager {
public:
AutofillOfferManager();
virtual ~AutofillOfferManager();
AutofillOfferManager(const AutofillOfferManager&) = delete;
AutofillOfferManager& operator=(const AutofillOfferManager&) = delete;
};
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_AUTOFILL_OFFER_MANAGER_H_
\ No newline at end of file
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