OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_ |
7 | 7 |
8 #include "components/autofill/core/browser/autofill_client.h" | 8 #include "components/autofill/core/browser/autofill_client.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 class WebContents; | 11 class WebContents; |
12 } | 12 } |
13 | 13 |
14 namespace autofill { | 14 namespace autofill { |
15 | 15 |
16 class CreditCardScannerView; | |
17 | |
18 // Controller for the credit card scanner UI. The controller deletes itself | 16 // Controller for the credit card scanner UI. The controller deletes itself |
19 // after the view is dismissed. | 17 // after the view is dismissed. |
20 class CreditCardScannerController { | 18 class CreditCardScannerController { |
21 public: | 19 public: |
22 // Returns true if both platform and device support scanning credit cards. The | 20 // 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. | 21 // platform must have the required APIs. The device must have, e.g., a camera. |
24 static bool HasCreditCardScanFeature(); | 22 static bool HasCreditCardScanFeature(); |
25 | 23 |
26 // Shows the UI to scan a credit card. The UI is associated with the | 24 // Shows the UI to scan a credit card. The UI is associated with the |
27 // |web_contents|. Notifies the |delegate| when scanning completes | 25 // |web_contents|. Notifies the |delegate| when scanning completes |
28 // successfully. Destroys itself when the UI is dismissed. Should be called | 26 // successfully. Destroys itself when the UI is dismissed. Should be called |
29 // only if HasCreditCardScanScanFeature() returns true. | 27 // only if HasCreditCardScanScanFeature() returns true. |
30 static void ScanCreditCard( | 28 static void ScanCreditCard( |
31 content::WebContents* web_contents, | 29 content::WebContents* web_contents, |
32 const AutofillClient::CreditCardScanCallback& callback); | 30 const AutofillClient::CreditCardScanCallback& callback); |
33 }; | 31 }; |
34 | 32 |
35 } // namespace autofill | 33 } // namespace autofill |
36 | 34 |
37 #endif // CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_ | 35 #endif // CHROME_BROWSER_UI_AUTOFILL_CREDIT_CARD_SCANNER_CONTROLLER_H_ |
OLD | NEW |