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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_dialog_view.h

Issue 2810193003: [Payments] Change how the dialog gets destroyed. (Closed)
Patch Set: added comment 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void ShowCvcUnmaskPrompt( 107 void ShowCvcUnmaskPrompt(
108 const autofill::CreditCard& credit_card, 108 const autofill::CreditCard& credit_card,
109 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> 109 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate>
110 result_delegate, 110 result_delegate,
111 content::WebContents* web_contents) override; 111 content::WebContents* web_contents) override;
112 112
113 // Shows a full dialog spinner with the "processing" label that doesn't offer 113 // Shows a full dialog spinner with the "processing" label that doesn't offer
114 // a way of closing the dialog. 114 // a way of closing the dialog.
115 void ShowProcessingSpinner(); 115 void ShowProcessingSpinner();
116 116
117 ViewStack* view_stack_for_testing() { return &view_stack_; } 117 ViewStack* view_stack_for_testing() { return view_stack_.get(); }
118 118
119 private: 119 private:
120 void ShowInitialPaymentSheet(); 120 void ShowInitialPaymentSheet();
121 void SetupSpinnerOverlay(); 121 void SetupSpinnerOverlay();
122 122
123 // views::View 123 // views::View
124 gfx::Size GetPreferredSize() const override; 124 gfx::Size GetPreferredSize() const override;
125 void ViewHierarchyChanged( 125 void ViewHierarchyChanged(
126 const ViewHierarchyChangedDetails& details) override; 126 const ViewHierarchyChangedDetails& details) override;
127 127
128 // Non-owned reference to the PaymentRequest that initiated this dialog. Since 128 // Non-owned reference to the PaymentRequest that initiated this dialog. Since
129 // the PaymentRequest object always outlives this one, the pointer should 129 // the PaymentRequest object always outlives this one, the pointer should
130 // always be valid even though there is no direct ownership relationship 130 // always be valid even though there is no direct ownership relationship
131 // between the two. 131 // between the two.
132 PaymentRequest* request_; 132 PaymentRequest* request_;
133 ControllerMap controller_map_; 133 ControllerMap controller_map_;
134 ViewStack view_stack_; 134 std::unique_ptr<ViewStack> view_stack_;
135 135
136 // A full dialog overlay that shows a spinner and the "processing" label. It's 136 // A full dialog overlay that shows a spinner and the "processing" label. It's
137 // hidden until ShowProcessingSpinner is called. 137 // hidden until ShowProcessingSpinner is called.
138 views::View throbber_overlay_; 138 views::View throbber_overlay_;
139 views::Throbber throbber_; 139 views::Throbber throbber_;
140 140
141 // May be null. 141 // May be null.
142 ObserverForTest* observer_for_testing_; 142 ObserverForTest* observer_for_testing_;
143 143
144 // Used when the dialog is being closed to avoid re-entrancy into the 144 // Used when the dialog is being closed to avoid re-entrancy into the
145 // controller_map_. 145 // controller_map_.
146 bool being_closed_; 146 bool being_closed_;
147 147
148 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); 148 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView);
149 }; 149 };
150 150
151 } // namespace payments 151 } // namespace payments
152 152
153 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ 153 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698