 Chromium Code Reviews
 Chromium Code Reviews Issue 2910153002:
  Remove views::Label::SetDisabledColor(). Replace with typography colors.  (Closed)
    
  
    Issue 2910153002:
  Remove views::Label::SetDisabledColor(). Replace with typography colors.  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 Loading... | |
| 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 "disabled" grey. | 
| 
Peter Kasting
2017/06/01 04:55:58
Nit: disabled -> hint?
This also applies in other
 
tapted
2017/06/01 11:22:18
Done.
 | |
| 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 714 return ValidateValue(combobox->GetTextForRow(combobox->selected_index()), | 711 return ValidateValue(combobox->GetTextForRow(combobox->selected_index()), | 
| 715 error_message); | 712 error_message); | 
| 716 } | 713 } | 
| 717 | 714 | 
| 718 bool CreditCardEditorViewController::GetSheetId(DialogViewID* sheet_id) { | 715 bool CreditCardEditorViewController::GetSheetId(DialogViewID* sheet_id) { | 
| 719 *sheet_id = DialogViewID::CREDIT_CARD_EDITOR_SHEET; | 716 *sheet_id = DialogViewID::CREDIT_CARD_EDITOR_SHEET; | 
| 720 return true; | 717 return true; | 
| 721 } | 718 } | 
| 722 | 719 | 
| 723 } // namespace payments | 720 } // namespace payments | 
| OLD | NEW |