1 // Copyright 2014 The Chromium Authors. 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.
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_
8 #include "components/autofill/core/browser/autofill_client.h"
16 class CreditCardScannerView
;
18 // Controller for the credit card scanner UI. The controller deletes itself
19 // after the view is dismissed.
20 class CreditCardScannerController
{
22 // Returns true if both platform and device support scanning credit cards. The
23 // platform must have the required APIs. The device must have, e.g., a camera.
24 static bool HasCreditCardScanFeature();
26 // Shows the UI to scan a credit card. The UI is associated with the
27 // |web_contents|. Notifies the |delegate| when scanning completes
28 // successfully. Destroys itself when the UI is dismissed. Should be called
29 // only if HasCreditCardScanScanFeature() returns true.
30 static void ScanCreditCard(
31 content::WebContents
* web_contents
,
32 const AutofillClient::CreditCardScanCallback
& callback
);
35 } // namespace autofill
37 #endif // CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_