51f8754ab8ea49cf06b698342458a800c3368cbe
[platform/framework/web/crosswalk-tizen.git] /
1 // Copyright 2017 Samsung Electronics Inc. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PAYMENT_REQUEST_DELEGATE_EFL_H_
6 #define PAYMENT_REQUEST_DELEGATE_EFL_H_
7
8 #include "base/macros.h"
9 #include "components/payments/payment_request_delegate.h"
10
11 namespace content {
12 class WebContents;
13 }
14
15 namespace payments {
16
17 class PaymentRequest;
18 class PaymentRequestDialog;
19
20 class PaymentRequestDelegateEfl : public PaymentRequestDelegate {
21  public:
22   explicit PaymentRequestDelegateEfl(content::WebContents* web_contents);
23   ~PaymentRequestDelegateEfl() override {}
24
25   void ShowDialog(PaymentRequest* request) override;
26   void CloseDialog() override;
27   autofill::PersonalDataManager* GetPersonalDataManager() override;
28
29  protected:
30   // Reference to the dialog so that we can satisfy calls to CloseDialog(). This
31   // reference is invalid once CloseDialog() has been called on it, because the
32   // dialog will be destroyed. Protected for testing.
33   PaymentRequestDialog* dialog_;
34
35  private:
36   // Not owned but outlives the PaymentRequest object that owns this.
37   content::WebContents* web_contents_;
38
39   DISALLOW_COPY_AND_ASSIGN(PaymentRequestDelegateEfl);
40 };
41
42 }  // namespace payments
43
44 #endif  // PAYMENT_REQUEST_DELEGATE_EFL_H_