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_VIEW_STACK_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VIEW_STACK_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VIEW_STACK_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VIEW_STACK_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
9 #include "ui/views/animation/bounds_animator.h" | 11 #include "ui/views/animation/bounds_animator.h" |
10 #include "ui/views/animation/bounds_animator_observer.h" | 12 #include "ui/views/animation/bounds_animator_observer.h" |
11 | 13 |
12 namespace payments { | 14 namespace payments { |
13 class PaymentRequestBrowserTestBase; | 15 class PaymentRequestBrowserTestBase; |
14 } // namespace payments | 16 } // namespace payments |
15 | 17 |
16 // This view represents a stack of views that slide in over one another from | 18 // This view represents a stack of views that slide in over one another from |
17 // left to right. It manages the animation and lifetime of views that are | 19 // left to right. It manages the animation and lifetime of views that are |
(...skipping 19 matching lines...) Expand all Loading... |
37 // result is an animation from the top-most view to the destination view. | 39 // result is an animation from the top-most view to the destination view. |
38 void PopMany(int n); | 40 void PopMany(int n); |
39 | 41 |
40 size_t size() const; | 42 size_t size() const; |
41 | 43 |
42 // views::View: | 44 // views::View: |
43 // The children of this view must not be able to process events when the views | 45 // The children of this view must not be able to process events when the views |
44 // are being animated so this returns false when an animation is in progress. | 46 // are being animated so this returns false when an animation is in progress. |
45 bool CanProcessEventsWithinSubtree() const override; | 47 bool CanProcessEventsWithinSubtree() const override; |
46 void Layout() override; | 48 void Layout() override; |
| 49 void RequestFocus() override; |
47 | 50 |
48 private: | 51 private: |
49 FRIEND_TEST_ALL_PREFIXES( | 52 FRIEND_TEST_ALL_PREFIXES( |
50 ViewStackTest, TestPopStateRemovesChildViewAndCleansUpState); | 53 ViewStackTest, TestPopStateRemovesChildViewAndCleansUpState); |
51 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestDeletingViewCleansUpState); | 54 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestDeletingViewCleansUpState); |
52 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestInitialStateAddedAsChildView); | 55 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestInitialStateAddedAsChildView); |
53 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestPushStateAddsViewToChildren); | 56 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestPushStateAddsViewToChildren); |
54 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestLayoutUpdatesAnimations); | 57 FRIEND_TEST_ALL_PREFIXES(ViewStackTest, TestLayoutUpdatesAnimations); |
55 friend class ViewStackTest; | 58 friend class ViewStackTest; |
56 friend class payments::PaymentRequestBrowserTestBase; | 59 friend class payments::PaymentRequestBrowserTestBase; |
(...skipping 12 matching lines...) Expand all Loading... |
69 std::unique_ptr<views::BoundsAnimator> slide_out_animator_; | 72 std::unique_ptr<views::BoundsAnimator> slide_out_animator_; |
70 | 73 |
71 // Should be the last member, because views need to be destroyed before other | 74 // Should be the last member, because views need to be destroyed before other |
72 // members, and members are destroyed in reverse order of their creation. | 75 // members, and members are destroyed in reverse order of their creation. |
73 std::vector<std::unique_ptr<views::View>> stack_; | 76 std::vector<std::unique_ptr<views::View>> stack_; |
74 | 77 |
75 DISALLOW_COPY_AND_ASSIGN(ViewStack); | 78 DISALLOW_COPY_AND_ASSIGN(ViewStack); |
76 }; | 79 }; |
77 | 80 |
78 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VIEW_STACK_H_ | 81 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VIEW_STACK_H_ |
OLD | NEW |