| Index: chrome/browser/ui/views/payments/view_stack.cc
|
| diff --git a/chrome/browser/ui/views/payments/view_stack.cc b/chrome/browser/ui/views/payments/view_stack.cc
|
| index 78f44ef73b87bea26d3d059054f024f29581085d..ac77c98e386461a3549f80965666fc9e2c2803d4 100644
|
| --- a/chrome/browser/ui/views/payments/view_stack.cc
|
| +++ b/chrome/browser/ui/views/payments/view_stack.cc
|
| @@ -49,6 +49,7 @@ void ViewStack::Push(std::unique_ptr<views::View> view, bool animate) {
|
| // Add the new view to the stack so it can be popped later when navigating
|
| // back to the previous screen.
|
| stack_.push_back(std::move(view));
|
| + RequestFocus();
|
| }
|
|
|
| void ViewStack::Pop() {
|
| @@ -95,6 +96,14 @@ void ViewStack::Layout() {
|
| UpdateAnimatorBounds(slide_out_animator_.get(), out_new_destination);
|
| }
|
|
|
| +void ViewStack::RequestFocus() {
|
| + // The view can only be focused if it has a widget already. It's possible that
|
| + // this isn't the case if some views are pushed before the stack is added to a
|
| + // hierarchy that has a widget.
|
| + if (top()->GetWidget())
|
| + top()->RequestFocus();
|
| +}
|
| +
|
| void ViewStack::UpdateAnimatorBounds(
|
| views::BoundsAnimator* animator, const gfx::Rect& target) {
|
| // If an animator is currently animating, figure out which views and update
|
| @@ -115,4 +124,5 @@ void ViewStack::OnBoundsAnimatorDone(views::BoundsAnimator* animator) {
|
|
|
| stack_.pop_back();
|
| DCHECK(!stack_.empty()) << "State stack should never be empty";
|
| + RequestFocus();
|
| }
|
|
|