| OLD | NEW |
| 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 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "chrome/browser/ui/views/payments/view_stack.h" | 13 #include "chrome/browser/ui/views/payments/view_stack.h" |
| 14 #include "components/payments/content/payment_request_dialog.h" | 14 #include "components/payments/content/payment_request_dialog.h" |
| 15 #include "components/payments/content/payment_request_spec.h" | 15 #include "components/payments/content/payment_request_spec.h" |
| 16 #include "ui/views/controls/throbber.h" | 16 #include "ui/views/controls/throbber.h" |
| 17 #include "ui/views/window/dialog_delegate.h" | 17 #include "ui/views/window/dialog_delegate.h" |
| 18 | 18 |
| 19 namespace autofill { | 19 namespace autofill { |
| 20 class AutofillProfile; | 20 class AutofillProfile; |
| 21 class CreditCard; | 21 class CreditCard; |
| 22 } // namespace autofill | 22 } // namespace autofill |
| 23 | 23 |
| 24 class Profile; |
| 25 |
| 24 namespace payments { | 26 namespace payments { |
| 25 | 27 |
| 26 class PaymentRequest; | 28 class PaymentRequest; |
| 27 class PaymentRequestSheetController; | 29 class PaymentRequestSheetController; |
| 28 | 30 |
| 29 // Maps views owned by PaymentRequestDialogView::view_stack_ to their | 31 // Maps views owned by PaymentRequestDialogView::view_stack_ to their |
| 30 // controller. PaymentRequestDialogView is responsible for listening for those | 32 // controller. PaymentRequestDialogView is responsible for listening for those |
| 31 // views being removed from the hierarchy and delete the associated controllers. | 33 // views being removed from the hierarchy and delete the associated controllers. |
| 32 using ControllerMap = | 34 using ControllerMap = |
| 33 std::map<views::View*, std::unique_ptr<PaymentRequestSheetController>>; | 35 std::map<views::View*, std::unique_ptr<PaymentRequestSheetController>>; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 void ShowCvcUnmaskPrompt( | 145 void ShowCvcUnmaskPrompt( |
| 144 const autofill::CreditCard& credit_card, | 146 const autofill::CreditCard& credit_card, |
| 145 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | 147 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| 146 result_delegate, | 148 result_delegate, |
| 147 content::WebContents* web_contents) override; | 149 content::WebContents* web_contents) override; |
| 148 | 150 |
| 149 // Shows a full dialog spinner with the "processing" label that doesn't offer | 151 // Shows a full dialog spinner with the "processing" label that doesn't offer |
| 150 // a way of closing the dialog. | 152 // a way of closing the dialog. |
| 151 void ShowProcessingSpinner(); | 153 void ShowProcessingSpinner(); |
| 152 | 154 |
| 155 Profile* GetProfile(); |
| 156 |
| 153 ViewStack* view_stack_for_testing() { return view_stack_.get(); } | 157 ViewStack* view_stack_for_testing() { return view_stack_.get(); } |
| 154 | 158 |
| 155 private: | 159 private: |
| 156 void ShowInitialPaymentSheet(); | 160 void ShowInitialPaymentSheet(); |
| 157 void SetupSpinnerOverlay(); | 161 void SetupSpinnerOverlay(); |
| 158 | 162 |
| 159 // views::View | 163 // views::View |
| 160 gfx::Size GetPreferredSize() const override; | 164 gfx::Size GetPreferredSize() const override; |
| 161 void ViewHierarchyChanged( | 165 void ViewHierarchyChanged( |
| 162 const ViewHierarchyChangedDetails& details) override; | 166 const ViewHierarchyChangedDetails& details) override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 180 // Used when the dialog is being closed to avoid re-entrancy into the | 184 // Used when the dialog is being closed to avoid re-entrancy into the |
| 181 // controller_map_. | 185 // controller_map_. |
| 182 bool being_closed_; | 186 bool being_closed_; |
| 183 | 187 |
| 184 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); | 188 DISALLOW_COPY_AND_ASSIGN(PaymentRequestDialogView); |
| 185 }; | 189 }; |
| 186 | 190 |
| 187 } // namespace payments | 191 } // namespace payments |
| 188 | 192 |
| 189 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ | 193 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_DIALOG_VIEW_H_ |
| OLD | NEW |