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

Side by Side Diff: chrome/browser/ui/views/payments/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/editor_view_controller.h" 5 #include "chrome/browser/ui/views/payments/editor_view_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (!initial_focus_field_view_ && !valid) 318 if (!initial_focus_field_view_ && !valid)
319 initial_focus_field_view_ = focusable_field; 319 initial_focus_field_view_ = focusable_field;
320 } 320 }
321 321
322 if (!initial_focus_field_view_) 322 if (!initial_focus_field_view_)
323 initial_focus_field_view_ = first_field; 323 initial_focus_field_view_ = first_field;
324 324
325 // Validate all fields and disable the primary (Done) button if necessary. 325 // Validate all fields and disable the primary (Done) button if necessary.
326 primary_button()->SetEnabled(ValidateInputFields()); 326 primary_button()->SetEnabled(ValidateInputFields());
327 327
328 // Adds the "* indicates a required field" label in "disabled" grey text.
329 std::unique_ptr<views::Label> required_field = base::MakeUnique<views::Label>(
330 l10n_util::GetStringUTF16(IDS_PAYMENTS_REQUIRED_FIELD_MESSAGE));
331 required_field->SetDisabledColor(
332 required_field->GetNativeTheme()->GetSystemColor(
333 ui::NativeTheme::kColorId_LabelDisabledColor));
334 required_field->SetEnabled(false);
335
336 views::ColumnSet* required_field_columns = editor_layout->AddColumnSet(2); 328 views::ColumnSet* required_field_columns = editor_layout->AddColumnSet(2);
337 required_field_columns->AddColumn(views::GridLayout::LEADING, 329 required_field_columns->AddColumn(views::GridLayout::LEADING,
338 views::GridLayout::CENTER, 1, 330 views::GridLayout::CENTER, 1,
339 views::GridLayout::USE_PREF, 0, 0); 331 views::GridLayout::USE_PREF, 0, 0);
340 editor_layout->StartRow(0, 2); 332 editor_layout->StartRow(0, 2);
341 editor_layout->AddView(required_field.release()); 333 // Adds the "* indicates a required field" label in "hint" grey text.
334 editor_layout->AddView(
335 CreateHintLabel(
336 l10n_util::GetStringUTF16(IDS_PAYMENTS_REQUIRED_FIELD_MESSAGE))
337 .release());
342 338
343 editor_view->SetLayoutManager(editor_layout.release()); 339 editor_view->SetLayoutManager(editor_layout.release());
344 340
345 return editor_view; 341 return editor_view;
346 } 342 }
347 343
348 // Each input field is a 4-quadrant grid. 344 // Each input field is a 4-quadrant grid.
349 // +----------------------------------------------------------+ 345 // +----------------------------------------------------------+
350 // | Field Label | Input field (textfield/combobox) | 346 // | Field Label | Input field (textfield/combobox) |
351 // |_______________________|__________________________________| 347 // |_______________________|__________________________________|
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 CreateExtraViewForField(field.type); 456 CreateExtraViewForField(field.type);
461 if (!extra_view) 457 if (!extra_view)
462 continue; 458 continue;
463 widest_column_width = 459 widest_column_width =
464 std::max(extra_view->GetPreferredSize().width(), widest_column_width); 460 std::max(extra_view->GetPreferredSize().width(), widest_column_width);
465 } 461 }
466 return widest_column_width; 462 return widest_column_width;
467 } 463 }
468 464
469 } // namespace payments 465 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698