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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_views_util.cc

Issue 2853163002: [Web Payments] Implement proper focusing in Payment Request (Closed)
Patch Set: Allow ViewControllers to specify their first focused view Created 3 years, 7 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 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" 5 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 1, views::GridLayout::USE_PREF, 0, 0); 181 1, views::GridLayout::USE_PREF, 0, 0);
182 182
183 layout->StartRow(0, 0); 183 layout->StartRow(0, 0);
184 if (!show_back_arrow) { 184 if (!show_back_arrow) {
185 layout->SkipColumns(1); 185 layout->SkipColumns(1);
186 } else { 186 } else {
187 views::ImageButton* back_arrow = views::CreateVectorImageButton(listener); 187 views::ImageButton* back_arrow = views::CreateVectorImageButton(listener);
188 views::SetImageFromVectorIcon(back_arrow, ui::kBackArrowIcon); 188 views::SetImageFromVectorIcon(back_arrow, ui::kBackArrowIcon);
189 constexpr int kBackArrowSize = 16; 189 constexpr int kBackArrowSize = 16;
190 back_arrow->SetSize(gfx::Size(kBackArrowSize, kBackArrowSize)); 190 back_arrow->SetSize(gfx::Size(kBackArrowSize, kBackArrowSize));
191 back_arrow->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
191 back_arrow->set_tag(static_cast<int>( 192 back_arrow->set_tag(static_cast<int>(
192 PaymentRequestCommonTags::BACK_BUTTON_TAG)); 193 PaymentRequestCommonTags::BACK_BUTTON_TAG));
193 back_arrow->set_id(static_cast<int>(DialogViewID::BACK_BUTTON)); 194 back_arrow->set_id(static_cast<int>(DialogViewID::BACK_BUTTON));
194 layout->AddView(back_arrow); 195 layout->AddView(back_arrow);
195 } 196 }
196 197
197 views::Label* title_label = new views::Label(title); 198 views::Label* title_label = new views::Label(title);
198 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 199 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
199 title_label->SetFontList( 200 title_label->SetFontList(
200 title_label->GetDefaultFontList().DeriveWithSizeDelta(2)); 201 title_label->GetDefaultFontList().DeriveWithSizeDelta(2));
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 amount_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 332 amount_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
332 amount_label->set_id( 333 amount_label->set_id(
333 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT)); 334 static_cast<int>(DialogViewID::SHIPPING_OPTION_AMOUNT));
334 container->AddChildView(amount_label.release()); 335 container->AddChildView(amount_label.release());
335 } 336 }
336 337
337 return container; 338 return container;
338 } 339 }
339 340
340 } // namespace payments 341 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698