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

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

Issue 15961007: Highlight fields we know to be invalid but have no way of locally checking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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 <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/ui/autofill/country_combobox_model.h" 21 #include "chrome/browser/ui/autofill/country_combobox_model.h"
22 #include "components/autofill/browser/autofill_manager_delegate.h" 22 #include "components/autofill/browser/autofill_manager_delegate.h"
23 #include "components/autofill/browser/autofill_metrics.h" 23 #include "components/autofill/browser/autofill_metrics.h"
24 #include "components/autofill/browser/autofill_popup_delegate.h" 24 #include "components/autofill/browser/autofill_popup_delegate.h"
25 #include "components/autofill/browser/field_types.h" 25 #include "components/autofill/browser/field_types.h"
26 #include "components/autofill/browser/form_structure.h" 26 #include "components/autofill/browser/form_structure.h"
27 #include "components/autofill/browser/personal_data_manager.h" 27 #include "components/autofill/browser/personal_data_manager.h"
28 #include "components/autofill/browser/personal_data_manager_observer.h" 28 #include "components/autofill/browser/personal_data_manager_observer.h"
29 #include "components/autofill/browser/wallet/wallet_client.h" 29 #include "components/autofill/browser/wallet/wallet_client.h"
30 #include "components/autofill/browser/wallet/wallet_client_delegate.h" 30 #include "components/autofill/browser/wallet/wallet_client_delegate.h"
31 #include "components/autofill/browser/wallet/wallet_items.h"
31 #include "components/autofill/browser/wallet/wallet_signin_helper_delegate.h" 32 #include "components/autofill/browser/wallet/wallet_signin_helper_delegate.h"
32 #include "content/public/browser/notification_observer.h" 33 #include "content/public/browser/notification_observer.h"
33 #include "content/public/browser/notification_registrar.h" 34 #include "content/public/browser/notification_registrar.h"
34 #include "content/public/common/ssl_status.h" 35 #include "content/public/common/ssl_status.h"
35 #include "googleurl/src/gurl.h" 36 #include "googleurl/src/gurl.h"
36 #include "ui/base/models/simple_menu_model.h" 37 #include "ui/base/models/simple_menu_model.h"
37 #include "ui/base/ui_base_types.h" 38 #include "ui/base/ui_base_types.h"
38 39
39 class Profile; 40 class Profile;
40 41
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 315
315 // Clears previously entered manual input, shows editing UI if the current 316 // Clears previously entered manual input, shows editing UI if the current
316 // suggestion is invalid, and updates the |view_| (if it exists). 317 // suggestion is invalid, and updates the |view_| (if it exists).
317 void PrepareDetailInputsForSection(DialogSection section); 318 void PrepareDetailInputsForSection(DialogSection section);
318 319
319 // Creates a DataModelWrapper item for the item that's checked in the 320 // Creates a DataModelWrapper item for the item that's checked in the
320 // suggestion model for |section|. This may represent Autofill 321 // suggestion model for |section|. This may represent Autofill
321 // data or Wallet data, depending on whether Wallet is currently enabled. 322 // data or Wallet data, depending on whether Wallet is currently enabled.
322 scoped_ptr<DataModelWrapper> CreateWrapper(DialogSection section); 323 scoped_ptr<DataModelWrapper> CreateWrapper(DialogSection section);
323 324
325 // Helper to return the current Wallet instrument. If the dialog isn't using
326 // Wallet or the user is adding a new instrument, NULL will be returned.
327 const wallet::WalletItems::MaskedInstrument* ActiveInstrument() const;
328
324 // Fills in |section|-related fields in |output_| according to the state of 329 // Fills in |section|-related fields in |output_| according to the state of
325 // |view_|. 330 // |view_|.
326 void FillOutputForSection(DialogSection section); 331 void FillOutputForSection(DialogSection section);
327 // As above, but uses |compare| to determine whether a DetailInput matches 332 // As above, but uses |compare| to determine whether a DetailInput matches
328 // a field. Saves any new Autofill data to the PersonalDataManager. 333 // a field. Saves any new Autofill data to the PersonalDataManager.
329 void FillOutputForSectionWithComparator(DialogSection section, 334 void FillOutputForSectionWithComparator(DialogSection section,
330 const InputFieldComparator& compare); 335 const InputFieldComparator& compare);
331 336
332 // Fills in |form_structure_| using |data_model|. Returns whether any matches 337 // Fills in |form_structure_| using |data_model|. Returns whether any matches
333 // were found in the form structure for the data in |section|. |data_model| 338 // were found in the form structure for the data in |section|. |data_model|
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 bool InputIsEditable(const DetailInput& input, DialogSection section) const; 416 bool InputIsEditable(const DetailInput& input, DialogSection section) const;
412 417
413 // Whether all of the input fields currently showing in the dialog have valid 418 // Whether all of the input fields currently showing in the dialog have valid
414 // contents. 419 // contents.
415 bool AllSectionsAreValid() const; 420 bool AllSectionsAreValid() const;
416 421
417 // Whether all of the input fields currently showing in the given |section| of 422 // Whether all of the input fields currently showing in the given |section| of
418 // the dialog have valid contents. 423 // the dialog have valid contents.
419 bool SectionIsValid(DialogSection section) const; 424 bool SectionIsValid(DialogSection section) const;
420 425
426 // Whether the currently active credit card expiration date is valid.
427 bool IsCreditCardExpirationValid(const base::string16& year,
428 const base::string16& month) const;
429
421 // Returns true if |key| refers to a suggestion, as opposed to some control 430 // Returns true if |key| refers to a suggestion, as opposed to some control
422 // menu item. 431 // menu item.
423 bool IsASuggestionItemKey(const std::string& key); 432 bool IsASuggestionItemKey(const std::string& key) const;
424 433
425 // Whether the billing section should be used to fill in the shipping details. 434 // Whether the billing section should be used to fill in the shipping details.
426 bool ShouldUseBillingForShipping(); 435 bool ShouldUseBillingForShipping();
427 436
428 // Whether the user wishes to save information locally to Autofill. 437 // Whether the user wishes to save information locally to Autofill.
429 bool ShouldSaveDetailsLocally(); 438 bool ShouldSaveDetailsLocally();
430 439
431 // Change whether the controller is currently submitting details to Autofill 440 // Change whether the controller is currently submitting details to Autofill
432 // or Online Wallet (|is_submitting_|) and update the view. 441 // or Online Wallet (|is_submitting_|) and update the view.
433 void SetIsSubmitting(bool submitting); 442 void SetIsSubmitting(bool submitting);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 648
640 // Whether the latency to display to the UI was logged to UMA yet. 649 // Whether the latency to display to the UI was logged to UMA yet.
641 bool was_ui_latency_logged_; 650 bool was_ui_latency_logged_;
642 651
643 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); 652 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl);
644 }; 653 };
645 654
646 } // namespace autofill 655 } // namespace autofill
647 656
648 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 657 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698