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

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

Issue 2910153002: Remove views::Label::SetDisabledColor(). Replace with typography colors. (Closed)
Patch Set: rebase for r476345 Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/credit_card_editor_view_controller.h" 5 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // the first input field. 197 // the first input field.
198 constexpr int kRowBottomPadding = 6; 198 constexpr int kRowBottomPadding = 6;
199 views::BoxLayout* layout = new views::BoxLayout( 199 views::BoxLayout* layout = new views::BoxLayout(
200 views::BoxLayout::kVertical, payments::kPaymentRequestRowHorizontalInsets, 200 views::BoxLayout::kVertical, payments::kPaymentRequestRowHorizontalInsets,
201 kRowBottomPadding, kRowVerticalSpacing); 201 kRowBottomPadding, kRowVerticalSpacing);
202 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); 202 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
203 layout->set_cross_axis_alignment( 203 layout->set_cross_axis_alignment(
204 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START); 204 views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
205 view->SetLayoutManager(layout); 205 view->SetLayoutManager(layout);
206 206
207 // "Cards accepted" label is "disabled" grey. 207 // "Cards accepted" label is "hint" grey.
208 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>( 208 view->AddChildView(CreateHintLabel(l10n_util::GetStringUTF16(
209 l10n_util::GetStringUTF16(IDS_PAYMENTS_ACCEPTED_CARDS_LABEL)); 209 IDS_PAYMENTS_ACCEPTED_CARDS_LABEL))
210 label->SetDisabledColor(label->GetNativeTheme()->GetSystemColor( 210 .release());
211 ui::NativeTheme::kColorId_LabelDisabledColor));
212 label->SetEnabled(false);
213 view->AddChildView(label.release());
214 211
215 // 8dp padding is required between icons. 212 // 8dp padding is required between icons.
216 constexpr int kPaddingBetweenCardIcons = 8; 213 constexpr int kPaddingBetweenCardIcons = 8;
217 std::unique_ptr<views::View> icons_row = base::MakeUnique<views::View>(); 214 std::unique_ptr<views::View> icons_row = base::MakeUnique<views::View>();
218 views::BoxLayout* icons_layout = new views::BoxLayout( 215 views::BoxLayout* icons_layout = new views::BoxLayout(
219 views::BoxLayout::kHorizontal, 0, 0, kPaddingBetweenCardIcons); 216 views::BoxLayout::kHorizontal, 0, 0, kPaddingBetweenCardIcons);
220 icons_row->SetLayoutManager(icons_layout); 217 icons_row->SetLayoutManager(icons_layout);
221 218
222 std::string selected_network = 219 std::string selected_network =
223 credit_card_to_edit_ ? autofill::data_util::GetPaymentRequestData( 220 credit_card_to_edit_ ? autofill::data_util::GetPaymentRequestData(
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 return ValidateValue(combobox->GetTextForRow(combobox->selected_index()), 709 return ValidateValue(combobox->GetTextForRow(combobox->selected_index()),
713 error_message); 710 error_message);
714 } 711 }
715 712
716 bool CreditCardEditorViewController::GetSheetId(DialogViewID* sheet_id) { 713 bool CreditCardEditorViewController::GetSheetId(DialogViewID* sheet_id) {
717 *sheet_id = DialogViewID::CREDIT_CARD_EDITOR_SHEET; 714 *sheet_id = DialogViewID::CREDIT_CARD_EDITOR_SHEET;
718 return true; 715 return true;
719 } 716 }
720 717
721 } // namespace payments 718 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698