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

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

Issue 12221040: Interactive autofill: Handle Online Wallet being unavailable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 const GURL& source_url, 54 const GURL& source_url,
55 const content::SSLStatus& ssl_status, 55 const content::SSLStatus& ssl_status,
56 const base::Callback<void(const FormStructure*)>& callback); 56 const base::Callback<void(const FormStructure*)>& callback);
57 virtual ~AutofillDialogControllerImpl(); 57 virtual ~AutofillDialogControllerImpl();
58 58
59 void Show(); 59 void Show();
60 void Hide(); 60 void Hide();
61 61
62 // AutofillDialogController implementation. 62 // AutofillDialogController implementation.
63 virtual string16 DialogTitle() const OVERRIDE; 63 virtual string16 DialogTitle() const OVERRIDE;
64 virtual string16 AccountChooserText() const OVERRIDE;
64 virtual string16 EditSuggestionText() const OVERRIDE; 65 virtual string16 EditSuggestionText() const OVERRIDE;
65 virtual string16 UseBillingForShippingText() const OVERRIDE; 66 virtual string16 UseBillingForShippingText() const OVERRIDE;
66 virtual string16 WalletOptionText() const OVERRIDE; 67 virtual string16 WalletOptionText() const OVERRIDE;
67 virtual string16 CancelButtonText() const OVERRIDE; 68 virtual string16 CancelButtonText() const OVERRIDE;
68 virtual string16 ConfirmButtonText() const OVERRIDE; 69 virtual string16 ConfirmButtonText() const OVERRIDE;
69 virtual string16 SignInText() const OVERRIDE;
70 virtual string16 SaveLocallyText() const OVERRIDE; 70 virtual string16 SaveLocallyText() const OVERRIDE;
71 virtual string16 CancelSignInText() const OVERRIDE; 71 virtual string16 CancelSignInText() const OVERRIDE;
72 virtual string16 ProgressBarText() const OVERRIDE; 72 virtual string16 ProgressBarText() const OVERRIDE;
73 virtual DialogSignedInState SignedInState() const OVERRIDE; 73 virtual DialogSignedInState SignedInState() const OVERRIDE;
74 virtual bool CanPayWithWallet() const OVERRIDE;
75 virtual bool AccountChooserEnabled() const OVERRIDE;
74 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) 76 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section)
75 const OVERRIDE; 77 const OVERRIDE;
76 virtual ui::ComboboxModel* ComboboxModelForAutofillType( 78 virtual ui::ComboboxModel* ComboboxModelForAutofillType(
77 AutofillFieldType type) OVERRIDE; 79 AutofillFieldType type) OVERRIDE;
78 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; 80 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE;
79 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; 81 virtual string16 LabelForSection(DialogSection section) const OVERRIDE;
80 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; 82 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE;
81 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; 83 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE;
82 virtual void EditClickedForSection(DialogSection section) OVERRIDE; 84 virtual void EditClickedForSection(DialogSection section) OVERRIDE;
83 virtual bool InputIsValid(AutofillFieldType type, const string16& value) 85 virtual bool InputIsValid(AutofillFieldType type, const string16& value)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 141
140 // Updates the progress bar based on the Autocheckout progress. |value| should 142 // Updates the progress bar based on the Autocheckout progress. |value| should
141 // be in [0.0, 1.0]. 143 // be in [0.0, 1.0].
142 void UpdateProgressBar(double value); 144 void UpdateProgressBar(double value);
143 145
144 private: 146 private:
145 // Determines whether |input| and |field| match. 147 // Determines whether |input| and |field| match.
146 typedef base::Callback<bool(const DetailInput& input, 148 typedef base::Callback<bool(const DetailInput& input,
147 const AutofillField& field)> InputFieldComparator; 149 const AutofillField& field)> InputFieldComparator;
148 150
151 // Refresh wallet items immediately if there's no refresh currently in
152 // progress, otherwise wait until the current refresh completes.
153 void ScheduleRefreshWalletItems();
154
155 // Called when any type of request to Online Wallet completes. |success| is
156 // true when there was no network error, the response wasn't malformed, and no
157 // Wallet error occurred.
158 void WalletRequestCompleted(bool success);
159
149 // Whether or not the current request wants credit info back. 160 // Whether or not the current request wants credit info back.
150 bool RequestingCreditCardInfo() const; 161 bool RequestingCreditCardInfo() const;
151 162
152 // Whether the information input in this dialog will be securely transmitted 163 // Whether the information input in this dialog will be securely transmitted
153 // to the requesting site. 164 // to the requesting site.
154 bool TransmissionWillBeSecure() const; 165 bool TransmissionWillBeSecure() const;
155 166
156 // Convenience method to tell whether we need to address |action|. 167 // Convenience method to tell whether we need to address |action|.
157 bool HasRequiredAction(wallet::RequiredAction action) const; 168 bool HasRequiredAction(wallet::RequiredAction action) const;
158 169
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 237
227 // The SSL info from the invoking site. 238 // The SSL info from the invoking site.
228 content::SSLStatus ssl_status_; 239 content::SSLStatus ssl_status_;
229 240
230 // The callback via which we return the collected data. 241 // The callback via which we return the collected data.
231 base::Callback<void(const FormStructure*)> callback_; 242 base::Callback<void(const FormStructure*)> callback_;
232 243
233 // A client to talk to the Online Wallet API. 244 // A client to talk to the Online Wallet API.
234 wallet::WalletClient wallet_client_; 245 wallet::WalletClient wallet_client_;
235 246
247 // Whether another refresh for WalletItems should be started when the current
248 // one is done.
249 bool refresh_wallet_items_queued_;
250
251 // Whether there has been a wallet error while this dialog has been open.
Ilya Sherman 2013/02/11 06:07:01 nit: "wallet" -> "Wallet"
Dan Beam 2013/02/11 21:53:54 Done.
252 bool had_wallet_error_;
253
236 // The most recently received WalletItems retrieved via |wallet_client_|. 254 // The most recently received WalletItems retrieved via |wallet_client_|.
237 scoped_ptr<wallet::WalletItems> wallet_items_; 255 scoped_ptr<wallet::WalletItems> wallet_items_;
238 256
239 // The fields for billing and shipping which the page has actually requested. 257 // The fields for billing and shipping which the page has actually requested.
240 DetailInputs requested_email_fields_; 258 DetailInputs requested_email_fields_;
241 DetailInputs requested_cc_fields_; 259 DetailInputs requested_cc_fields_;
242 DetailInputs requested_billing_fields_; 260 DetailInputs requested_billing_fields_;
243 DetailInputs requested_shipping_fields_; 261 DetailInputs requested_shipping_fields_;
244 262
245 // Models for the credit card expiration inputs. 263 // Models for the credit card expiration inputs.
(...skipping 25 matching lines...) Expand all
271 289
272 // A NotificationRegistrar for tracking the completion of sign-in. 290 // A NotificationRegistrar for tracking the completion of sign-in.
273 content::NotificationRegistrar registrar_; 291 content::NotificationRegistrar registrar_;
274 292
275 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); 293 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl);
276 }; 294 };
277 295
278 } // namespace autofill 296 } // namespace autofill
279 297
280 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 298 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698