Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/browser/ui/autofill/chrome_autofill_client.h

Issue 756333003: Prompt for unmasking Wallet credit card on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile and docs Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CHROME_AUTOFILL_CLIENT_H_ 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ 6 #define CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/ui/zoom/zoom_observer.h" 13 #include "chrome/browser/ui/zoom/zoom_observer.h"
13 #include "components/autofill/core/browser/autofill_client.h" 14 #include "components/autofill/core/browser/autofill_client.h"
14 #include "content/public/browser/web_contents_observer.h" 15 #include "content/public/browser/web_contents_observer.h"
15 #include "content/public/browser/web_contents_user_data.h" 16 #include "content/public/browser/web_contents_user_data.h"
16 17
17 namespace content { 18 namespace content {
18 struct FrameNavigateParams; 19 struct FrameNavigateParams;
19 struct LoadCommittedDetails; 20 struct LoadCommittedDetails;
20 class WebContents; 21 class WebContents;
21 } 22 }
22 23
23 namespace autofill { 24 namespace autofill {
24 25
25 class AutofillDialogController; 26 class AutofillDialogController;
26 class AutofillKeystoneBridgeWrapper; 27 class AutofillKeystoneBridgeWrapper;
27 class AutofillPopupControllerImpl; 28 class AutofillPopupControllerImpl;
28 class CreditCardScannerController; 29 class CreditCardScannerController;
30 class InstrumentUnmaskPromptView;
Ted C 2014/12/10 22:04:59 delete?
Evan Stade 2014/12/10 23:46:20 Done.
29 struct FormData; 31 struct FormData;
30 32
31 // Chrome implementation of AutofillClient. 33 // Chrome implementation of AutofillClient.
32 class ChromeAutofillClient 34 class ChromeAutofillClient
33 : public AutofillClient, 35 : public AutofillClient,
34 public content::WebContentsUserData<ChromeAutofillClient>, 36 public content::WebContentsUserData<ChromeAutofillClient>,
35 public content::WebContentsObserver, 37 public content::WebContentsObserver,
36 public ZoomObserver { 38 public ZoomObserver {
37 public: 39 public:
38 ~ChromeAutofillClient() override; 40 ~ChromeAutofillClient() override;
39 41
40 // Called when the tab corresponding to |this| instance is activated. 42 // Called when the tab corresponding to |this| instance is activated.
41 void TabActivated(); 43 void TabActivated();
42 44
43 // AutofillClient: 45 // AutofillClient:
44 PersonalDataManager* GetPersonalDataManager() override; 46 PersonalDataManager* GetPersonalDataManager() override;
45 scoped_refptr<AutofillWebDataService> GetDatabase() override; 47 scoped_refptr<AutofillWebDataService> GetDatabase() override;
46 PrefService* GetPrefs() override; 48 PrefService* GetPrefs() override;
47 void HideRequestAutocompleteDialog() override; 49 void HideRequestAutocompleteDialog() override;
48 void ShowAutofillSettings() override; 50 void ShowAutofillSettings() override;
51 void ShowUnmaskPrompt() override;
49 void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger, 52 void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger,
50 const base::Closure& save_card_callback) override; 53 const base::Closure& save_card_callback) override;
51 bool HasCreditCardScanFeature() override; 54 bool HasCreditCardScanFeature() override;
52 void ScanCreditCard(const CreditCardScanCallback& callback) override; 55 void ScanCreditCard(const CreditCardScanCallback& callback) override;
53 void ShowRequestAutocompleteDialog(const FormData& form, 56 void ShowRequestAutocompleteDialog(const FormData& form,
54 const GURL& source_url, 57 const GURL& source_url,
55 const ResultCallback& callback) override; 58 const ResultCallback& callback) override;
56 void ShowAutofillPopup( 59 void ShowAutofillPopup(
57 const gfx::RectF& element_bounds, 60 const gfx::RectF& element_bounds,
58 base::i18n::TextDirection text_direction, 61 base::i18n::TextDirection text_direction,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 private: 94 private:
92 #if defined(OS_MACOSX) && !defined(OS_IOS) 95 #if defined(OS_MACOSX) && !defined(OS_IOS)
93 // Creates |bridge_wrapper_|, which is responsible for dealing with Keystone 96 // Creates |bridge_wrapper_|, which is responsible for dealing with Keystone
94 // notifications. 97 // notifications.
95 void RegisterForKeystoneNotifications(); 98 void RegisterForKeystoneNotifications();
96 99
97 // Deletes |bridge_wrapper_|. 100 // Deletes |bridge_wrapper_|.
98 void UnregisterFromKeystoneNotifications(); 101 void UnregisterFromKeystoneNotifications();
99 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 102 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
100 103
104 void OnUnmaskResponse(const base::string16& response);
105
101 explicit ChromeAutofillClient(content::WebContents* web_contents); 106 explicit ChromeAutofillClient(content::WebContents* web_contents);
102 friend class content::WebContentsUserData<ChromeAutofillClient>; 107 friend class content::WebContentsUserData<ChromeAutofillClient>;
103 108
104 content::WebContents* const web_contents_;
105 base::WeakPtr<AutofillDialogController> dialog_controller_; 109 base::WeakPtr<AutofillDialogController> dialog_controller_;
106 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; 110 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_;
107 111
108 #if defined(OS_MACOSX) && !defined(OS_IOS) 112 #if defined(OS_MACOSX) && !defined(OS_IOS)
109 // Listens to Keystone notifications and passes relevant ones on to the 113 // Listens to Keystone notifications and passes relevant ones on to the
110 // PersonalDataManager. 114 // PersonalDataManager.
111 // 115 //
112 // The class of this member must remain a forward declaration, even in the 116 // The class of this member must remain a forward declaration, even in the
113 // .cc implementation file, since the class is defined in a Mac-only 117 // .cc implementation file, since the class is defined in a Mac-only
114 // implementation file. This means that the pointer cannot be wrapped in a 118 // implementation file. This means that the pointer cannot be wrapped in a
115 // scoped_ptr. 119 // scoped_ptr.
116 AutofillKeystoneBridgeWrapper* bridge_wrapper_; 120 AutofillKeystoneBridgeWrapper* bridge_wrapper_;
117 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 121 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
118 122
123 base::WeakPtrFactory<ChromeAutofillClient> weak_pointer_factory_;
124
119 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient); 125 DISALLOW_COPY_AND_ASSIGN(ChromeAutofillClient);
120 }; 126 };
121 127
122 } // namespace autofill 128 } // namespace autofill
123 129
124 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_ 130 #endif // CHROME_BROWSER_UI_AUTOFILL_CHROME_AUTOFILL_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698