1 // Copyright 2013 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 IOS_CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_CLIENT_IOS_H_
6 #define IOS_CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_CLIENT_IOS_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "components/autofill/core/browser/autofill_client.h"
13 #include "components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h"
14 #include "components/autofill/ios/browser/autofill_client_ios_bridge.h"
16 class IdentityProvider
;
23 class ChromeBrowserState
;
26 namespace password_manager
{
27 class PasswordGenerationManager
;
32 class PersonalDataManager
;
34 // iOS implementation of AutofillClient.
35 // TODO(dconnelly): Split this up, as it collects functionality that doesn't
36 // necessarily fit together on iOS. http://crbug.com/432487.
37 class AutofillClientIOS
: public AutofillClient
{
40 ios::ChromeBrowserState
* browser_state
,
41 infobars::InfoBarManager
* infobar_manager
,
42 id
<AutofillClientIOSBridge
> bridge
,
43 password_manager::PasswordGenerationManager
* password_generation_manager
,
44 scoped_ptr
<IdentityProvider
> identity_provider
);
45 ~AutofillClientIOS() override
;
47 // AutofillClient implementation.
48 PersonalDataManager
* GetPersonalDataManager() override
;
49 PrefService
* GetPrefs() override
;
50 IdentityProvider
* GetIdentityProvider() override
;
51 rappor::RapporService
* GetRapporService() override
;
52 void HideRequestAutocompleteDialog() override
;
53 void ShowAutofillSettings() override
;
54 void ShowUnmaskPrompt(const CreditCard
& card
,
55 base::WeakPtr
<CardUnmaskDelegate
> delegate
) override
;
56 void OnUnmaskVerificationResult(GetRealPanResult result
) override
;
57 void ConfirmSaveCreditCard(const base::Closure
& save_card_callback
) override
;
58 bool HasCreditCardScanFeature() override
;
59 void ScanCreditCard(const CreditCardScanCallback
& callback
) override
;
60 void ShowRequestAutocompleteDialog(
62 content::RenderFrameHost
* render_frame_host
,
63 const ResultCallback
& callback
) override
;
64 void ShowAutofillPopup(
65 const gfx::RectF
& element_bounds
,
66 base::i18n::TextDirection text_direction
,
67 const std::vector
<Suggestion
>& suggestions
,
68 base::WeakPtr
<AutofillPopupDelegate
> delegate
) override
;
69 void HideAutofillPopup() override
;
70 bool IsAutocompleteEnabled() override
;
71 void UpdateAutofillPopupDataListValues(
72 const std::vector
<base::string16
>& values
,
73 const std::vector
<base::string16
>& labels
) override
;
74 void PropagateAutofillPredictions(
75 content::RenderFrameHost
* rfh
,
76 const std::vector
<FormStructure
*>& forms
) override
;
77 void DidFillOrPreviewField(const base::string16
& autofilled_value
,
78 const base::string16
& profile_full_name
) override
;
79 void OnFirstUserGestureObserved() override
;
80 void LinkClicked(const GURL
& url
, WindowOpenDisposition disposition
) override
;
81 scoped_refptr
<AutofillWebDataService
> GetDatabase() override
;
82 bool IsContextSecure(const GURL
& form_origin
) override
;
85 ios::ChromeBrowserState
* browser_state_
;
86 infobars::InfoBarManager
* infobar_manager_
;
87 id
<AutofillClientIOSBridge
> bridge_
; // Weak
88 password_manager::PasswordGenerationManager
* password_generation_manager_
;
89 scoped_ptr
<IdentityProvider
> identity_provider_
;
90 CardUnmaskPromptControllerImpl unmask_controller_
;
92 DISALLOW_COPY_AND_ASSIGN(AutofillClientIOS
);
95 } // namespace autofill
97 #endif // IOS_CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_CLIENT_IOS_H_