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

Unified Diff: chrome/browser/ui/views/payments/profile_list_view_controller.cc

Issue 2816083002: [WebPayments] Desktop implementation of Contact Editor (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/payments/profile_list_view_controller.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/profile_list_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/profile_list_view_controller.cc b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
index 419b51e4fc07ec05fb7e9b87d7a7c7c1bd70c037..5fe018fd43039567cf72089fbb3f42e5b1da5b50 100644
--- a/chrome/browser/ui/views/payments/profile_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
@@ -81,7 +81,7 @@ class ProfileItem : public PaymentRequestItemList::Item {
}
void PerformSelectionFallback() override {
- dialog_->ShowShippingAddressEditor(profile_);
+ parent_view_->ShowEditor(profile_);
}
ProfileListViewController* parent_view_;
@@ -115,6 +115,10 @@ class ShippingProfileViewController : public ProfileListViewController {
state()->SetSelectedShippingProfile(profile);
}
+ void ShowEditor(autofill::AutofillProfile* profile) override {
+ dialog()->ShowShippingAddressEditor(profile);
+ }
+
autofill::AutofillProfile* GetSelectedProfile() override {
return state()->selected_shipping_profile();
}
@@ -144,10 +148,6 @@ class ShippingProfileViewController : public ProfileListViewController {
return static_cast<int>(DialogViewID::PAYMENT_METHOD_ADD_SHIPPING_BUTTON);
}
- void OnSecondaryButtonPressed() override {
- dialog()->ShowShippingAddressEditor();
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(ShippingProfileViewController);
};
@@ -175,6 +175,10 @@ class ContactProfileViewController : public ProfileListViewController {
state()->SetSelectedContactProfile(profile);
}
+ void ShowEditor(autofill::AutofillProfile* profile) override {
+ dialog()->ShowContactInfoEditor(profile);
+ }
+
autofill::AutofillProfile* GetSelectedProfile() override {
return state()->selected_contact_profile();
}
@@ -205,10 +209,6 @@ class ContactProfileViewController : public ProfileListViewController {
return static_cast<int>(DialogViewID::PAYMENT_METHOD_ADD_CONTACT_BUTTON);
}
- void OnSecondaryButtonPressed() override {
- // TODO(crbug.com/704263): Add Contact Editor.
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(ContactProfileViewController);
};
@@ -279,7 +279,7 @@ ProfileListViewController::CreateExtraFooterView() {
void ProfileListViewController::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (sender->tag() == GetSecondaryButtonTag())
- OnSecondaryButtonPressed();
+ ShowEditor(nullptr);
else
PaymentRequestSheetController::ButtonPressed(sender, event);
}
« no previous file with comments | « chrome/browser/ui/views/payments/profile_list_view_controller.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698