OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PAYMENTS_UI_PAYMENT_DIALOG_STATE_H_ | |
6 #define CHROME_BROWSER_PAYMENTS_UI_PAYMENT_DIALOG_STATE_H_ | |
7 | |
8 #include "base/macros.h" | |
9 | |
10 namespace views { | |
11 class View; | |
12 } | |
13 | |
14 namespace payments { | |
15 | |
16 // Base class for the different WebPayments UI states. | |
17 class PaymentDialogState { | |
18 public: | |
19 // Create the view associated with this state if needed and return it. | |
20 virtual views::View* GetView() = 0; | |
please use gerrit instead
2016/11/22 21:39:33
Specify who owns the returned view.
anthonyvd
2016/11/22 22:11:19
Done.
| |
21 | |
22 // Marks the state as interactable or not depending on |interactable|. States | |
23 // should be marked as non-interactable when they are being transitioned out | |
24 // or have another state being transitioned in on top of them. A non- | |
25 // interactable state shouldn't trigger events at all. This is to prevent non- | |
26 // foreground states from being interacted with. | |
27 void SetInteractable(bool interactable) { | |
28 interactable_ = interactable; | |
29 } | |
30 | |
31 bool interactable() { return interactable_; } | |
32 | |
33 protected: | |
34 PaymentDialogState() {} | |
please use gerrit instead
2016/11/22 21:39:32
Rule of thumb is that a constructor should always
anthonyvd
2016/11/22 22:11:19
Done. Moved to public to satisfy unique_ptr templa
| |
35 | |
36 private: | |
37 bool interactable_; | |
38 DISALLOW_COPY_AND_ASSIGN(PaymentDialogState); | |
39 }; | |
40 | |
41 } // namespace payments | |
42 | |
43 #endif // CHROME_BROWSER_PAYMENTS_UI_PAYMENT_DIALOG_STATE_H_ | |
OLD | NEW |