| 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 AccountChooserText() 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 SaveLocallyText() const OVERRIDE; | 69 virtual string16 SaveLocallyText() const OVERRIDE; |
| 70 virtual string16 CancelSignInText() const OVERRIDE; | 70 virtual string16 CancelSignInText() const OVERRIDE; |
| 71 virtual string16 ProgressBarText() const OVERRIDE; | 71 virtual string16 ProgressBarText() const OVERRIDE; |
| 72 virtual DialogSignedInState SignedInState() const OVERRIDE; | 72 virtual DialogSignedInState SignedInState() const OVERRIDE; |
| 73 virtual bool CanPayWithWallet() const OVERRIDE; |
| 74 virtual bool AccountChooserEnabled() const OVERRIDE; |
| 73 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 75 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
| 74 const OVERRIDE; | 76 const OVERRIDE; |
| 75 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 77 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
| 76 AutofillFieldType type) OVERRIDE; | 78 AutofillFieldType type) OVERRIDE; |
| 77 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; | 79 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; |
| 78 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; | 80 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; |
| 79 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; | 81 virtual string16 SuggestionTextForSection(DialogSection section) OVERRIDE; |
| 80 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; | 82 virtual gfx::Image SuggestionIconForSection(DialogSection section) OVERRIDE; |
| 81 virtual void EditClickedForSection(DialogSection section) OVERRIDE; | 83 virtual void EditClickedForSection(DialogSection section) OVERRIDE; |
| 82 virtual bool InputIsValid(const DetailInput* input, const string16& value) | 84 virtual bool InputIsValid(const DetailInput* input, const string16& value) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 139 |
| 138 // Updates the progress bar based on the Autocheckout progress. |value| should | 140 // Updates the progress bar based on the Autocheckout progress. |value| should |
| 139 // be in [0.0, 1.0]. | 141 // be in [0.0, 1.0]. |
| 140 void UpdateProgressBar(double value); | 142 void UpdateProgressBar(double value); |
| 141 | 143 |
| 142 private: | 144 private: |
| 143 // Determines whether |input| and |field| match. | 145 // Determines whether |input| and |field| match. |
| 144 typedef base::Callback<bool(const DetailInput& input, | 146 typedef base::Callback<bool(const DetailInput& input, |
| 145 const AutofillField& field)> InputFieldComparator; | 147 const AutofillField& field)> InputFieldComparator; |
| 146 | 148 |
| 149 // Refresh wallet items immediately if there's no refresh currently in |
| 150 // progress, otherwise wait until the current refresh completes. |
| 151 void ScheduleRefreshWalletItems(); |
| 152 |
| 153 // Called when any type of request to Online Wallet completes. |success| is |
| 154 // true when there was no network error, the response wasn't malformed, and no |
| 155 // Wallet error occurred. |
| 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 another refresh for WalletItems should be started when the current |
| 243 // one is done. |
| 244 bool refresh_wallet_items_queued_; |
| 245 |
| 246 // Whether there has been a wallet error while this dialog has been open. |
| 247 bool had_wallet_error_; |
| 248 |
| 231 // The most recently received WalletItems retrieved via |wallet_client_|. | 249 // The most recently received WalletItems retrieved via |wallet_client_|. |
| 232 scoped_ptr<wallet::WalletItems> wallet_items_; | 250 scoped_ptr<wallet::WalletItems> wallet_items_; |
| 233 | 251 |
| 234 // The fields for billing and shipping which the page has actually requested. | 252 // The fields for billing and shipping which the page has actually requested. |
| 235 DetailInputs requested_email_fields_; | 253 DetailInputs requested_email_fields_; |
| 236 DetailInputs requested_cc_fields_; | 254 DetailInputs requested_cc_fields_; |
| 237 DetailInputs requested_billing_fields_; | 255 DetailInputs requested_billing_fields_; |
| 238 DetailInputs requested_shipping_fields_; | 256 DetailInputs requested_shipping_fields_; |
| 239 | 257 |
| 240 // Models for the credit card expiration inputs. | 258 // Models for the credit card expiration inputs. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 266 | 284 |
| 267 // A NotificationRegistrar for tracking the completion of sign-in. | 285 // A NotificationRegistrar for tracking the completion of sign-in. |
| 268 content::NotificationRegistrar registrar_; | 286 content::NotificationRegistrar registrar_; |
| 269 | 287 |
| 270 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 288 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 271 }; | 289 }; |
| 272 | 290 |
| 273 } // namespace autofill | 291 } // namespace autofill |
| 274 | 292 |
| 275 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 293 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |