Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 const GURL& source_url, | 53 const GURL& source_url, |
| 54 const content::SSLStatus& ssl_status, | 54 const content::SSLStatus& ssl_status, |
| 55 const base::Callback<void(const FormStructure*)>& callback); | 55 const base::Callback<void(const FormStructure*)>& callback); |
| 56 virtual ~AutofillDialogControllerImpl(); | 56 virtual ~AutofillDialogControllerImpl(); |
| 57 | 57 |
| 58 void Show(); | 58 void Show(); |
| 59 void Hide(); | 59 void Hide(); |
| 60 | 60 |
| 61 // AutofillDialogController implementation. | 61 // AutofillDialogController implementation. |
| 62 virtual string16 DialogTitle() const OVERRIDE; | 62 virtual string16 DialogTitle() const OVERRIDE; |
| 63 virtual string16 PayWithoutWallet() const OVERRIDE; | |
| 63 virtual string16 EditSuggestionText() const OVERRIDE; | 64 virtual string16 EditSuggestionText() const OVERRIDE; |
| 64 virtual string16 UseBillingForShippingText() const OVERRIDE; | 65 virtual string16 UseBillingForShippingText() const OVERRIDE; |
| 65 virtual string16 WalletOptionText() const OVERRIDE; | 66 virtual string16 WalletOptionText() const OVERRIDE; |
| 66 virtual string16 CancelButtonText() const OVERRIDE; | 67 virtual string16 CancelButtonText() const OVERRIDE; |
| 67 virtual string16 ConfirmButtonText() const OVERRIDE; | 68 virtual string16 ConfirmButtonText() const OVERRIDE; |
| 68 virtual string16 SignInText() const OVERRIDE; | 69 virtual string16 SignInText() const OVERRIDE; |
| 70 virtual string16 SignedInUser() const OVERRIDE; | |
| 69 virtual string16 SaveLocallyText() const OVERRIDE; | 71 virtual string16 SaveLocallyText() const OVERRIDE; |
| 70 virtual string16 CancelSignInText() const OVERRIDE; | 72 virtual string16 CancelSignInText() const OVERRIDE; |
| 71 virtual string16 ProgressBarText() const OVERRIDE; | 73 virtual string16 ProgressBarText() const OVERRIDE; |
| 72 virtual DialogSignedInState SignedInState() const OVERRIDE; | 74 virtual DialogSignedInState SignedInState() const OVERRIDE; |
| 75 virtual bool IsWalletAvailable() const OVERRIDE; | |
| 73 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 76 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
| 74 const OVERRIDE; | 77 const OVERRIDE; |
| 75 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 78 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
| 76 AutofillFieldType type) OVERRIDE; | 79 AutofillFieldType type) OVERRIDE; |
| 77 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; | 80 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; |
| 78 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; | 81 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; |
| 79 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; | 82 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; |
| 80 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; | 83 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; |
| 81 virtual void EditClickedForSection(DialogSection section) OVERRIDE; | 84 virtual void EditClickedForSection(DialogSection section) OVERRIDE; |
| 82 virtual bool InputIsValid(const DetailInput* input, const string16& value) | 85 virtual bool InputIsValid(const DetailInput* input, const string16& value) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 | 140 |
| 138 // Updates the progress bar based on the Autocheckout progress. |value| should | 141 // Updates the progress bar based on the Autocheckout progress. |value| should |
| 139 // be in [0.0, 1.0]. | 142 // be in [0.0, 1.0]. |
| 140 void UpdateProgressBar(double value); | 143 void UpdateProgressBar(double value); |
| 141 | 144 |
| 142 private: | 145 private: |
| 143 // Determines whether |input| and |field| match. | 146 // Determines whether |input| and |field| match. |
| 144 typedef base::Callback<bool(const DetailInput& input, | 147 typedef base::Callback<bool(const DetailInput& input, |
| 145 const AutofillField& field)> InputFieldComparator; | 148 const AutofillField& field)> InputFieldComparator; |
| 146 | 149 |
| 150 // Refresh wallet items when there's not a request in progress. | |
|
Evan Stade
2013/02/06 21:57:49
"Refresh wallet items immediately if there's no re
Dan Beam
2013/02/07 01:22:40
Done.
| |
| 151 void ScheduleRefreshWalletItems(); | |
| 152 | |
| 153 // Called when a request to Online Wallet completes. |success| is true when | |
| 154 // there was no network error, the response wasn't malformed, and no Wallet | |
| 155 // error occurred. | |
|
Evan Stade
2013/02/06 21:57:49
good example of a helpful comment.
Dan Beam
2013/02/07 01:22:40
If only my brain worked the same way at all times
| |
| 156 void WalletRequestCompleted(bool success); | |
| 157 | |
| 147 // Whether or not the current request wants credit info back. | 158 // Whether or not the current request wants credit info back. |
| 148 bool RequestingCreditCardInfo() const; | 159 bool RequestingCreditCardInfo() const; |
| 149 | 160 |
| 150 // Whether the information input in this dialog will be securely transmitted | 161 // Whether the information input in this dialog will be securely transmitted |
| 151 // to the requesting site. | 162 // to the requesting site. |
| 152 bool TransmissionWillBeSecure() const; | 163 bool TransmissionWillBeSecure() const; |
| 153 | 164 |
| 154 // Convenience method to tell whether we need to address |action|. | 165 // Convenience method to tell whether we need to address |action|. |
| 155 bool HasRequiredAction(wallet::RequiredAction action) const; | 166 bool HasRequiredAction(wallet::RequiredAction action) const; |
| 156 | 167 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 232 |
| 222 // The SSL info from the invoking site. | 233 // The SSL info from the invoking site. |
| 223 content::SSLStatus ssl_status_; | 234 content::SSLStatus ssl_status_; |
| 224 | 235 |
| 225 // The callback via which we return the collected data. | 236 // The callback via which we return the collected data. |
| 226 base::Callback<void(const FormStructure*)> callback_; | 237 base::Callback<void(const FormStructure*)> callback_; |
| 227 | 238 |
| 228 // A client to talk to the Online Wallet API. | 239 // A client to talk to the Online Wallet API. |
| 229 wallet::WalletClient wallet_client_; | 240 wallet::WalletClient wallet_client_; |
| 230 | 241 |
| 242 // Whether there's currently a request for WalletItems in progress. | |
| 243 bool refresh_wallet_items_in_progress_; | |
|
Evan Stade
2013/02/06 21:57:49
the seemingly interchangeable use of "refresh" and
Dan Beam
2013/02/07 01:22:40
Oh, sorry, these were named request_* before, I th
| |
| 244 | |
| 245 // Whether another request for WalletItems should be started when the current | |
| 246 // one is done. | |
| 247 bool refresh_wallet_items_queued_; | |
| 248 | |
| 249 // Whether there has been a wallet error while this dialog has been open. | |
| 250 bool had_wallet_error_; | |
| 251 | |
| 231 // The most recently received WalletItems retrieved via |wallet_client_|. | 252 // The most recently received WalletItems retrieved via |wallet_client_|. |
| 232 scoped_ptr<wallet::WalletItems> wallet_items_; | 253 scoped_ptr<wallet::WalletItems> wallet_items_; |
| 233 | 254 |
| 234 // The fields for billing and shipping which the page has actually requested. | 255 // The fields for billing and shipping which the page has actually requested. |
| 235 DetailInputs requested_email_fields_; | 256 DetailInputs requested_email_fields_; |
| 236 DetailInputs requested_cc_fields_; | 257 DetailInputs requested_cc_fields_; |
| 237 DetailInputs requested_billing_fields_; | 258 DetailInputs requested_billing_fields_; |
| 238 DetailInputs requested_shipping_fields_; | 259 DetailInputs requested_shipping_fields_; |
| 239 | 260 |
| 240 // Models for the credit card expiration inputs. | 261 // Models for the credit card expiration inputs. |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 266 | 287 |
| 267 // A NotificationRegistrar for tracking the completion of sign-in. | 288 // A NotificationRegistrar for tracking the completion of sign-in. |
| 268 content::NotificationRegistrar registrar_; | 289 content::NotificationRegistrar registrar_; |
| 269 | 290 |
| 270 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 291 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 271 }; | 292 }; |
| 272 | 293 |
| 273 } // namespace autofill | 294 } // namespace autofill |
| 274 | 295 |
| 275 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 296 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |