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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 15061006: views: Switch Checkbox over to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more review comments Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autofill/autofill_dialog_views.h" 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 // We have to do this instead of using set_border() because a border 505 // We have to do this instead of using set_border() because a border
506 // is being used to draw the check square. 506 // is being used to draw the check square.
507 static_cast<views::CheckboxNativeThemeBorder*>(checkbox->border())-> 507 static_cast<views::CheckboxNativeThemeBorder*>(checkbox->border())->
508 SetCustomInsets(gfx::Insets(kNotificationPadding, 508 SetCustomInsets(gfx::Insets(kNotificationPadding,
509 kNotificationPadding, 509 kNotificationPadding,
510 kNotificationPadding, 510 kNotificationPadding,
511 kNotificationPadding)); 511 kNotificationPadding));
512 if (!notification.interactive()) 512 if (!notification.interactive())
513 checkbox->SetState(views::Button::STATE_DISABLED); 513 checkbox->SetState(views::Button::STATE_DISABLED);
514 checkbox->SetText(notification.display_text()); 514 checkbox->SetText(notification.display_text());
515 checkbox->SetMultiLine(true); 515 checkbox->SetTextMultiLine(true);
516 checkbox->set_alignment(views::TextButtonBase::ALIGN_LEFT); 516 checkbox->SetHorizontalAlignment(gfx::ALIGN_LEFT);
517 checkbox->SetEnabledColor(notification.GetTextColor()); 517 checkbox->SetTextColor(views::Button::STATE_NORMAL,
518 checkbox->SetHoverColor(notification.GetTextColor()); 518 notification.GetTextColor());
519 checkbox->SetTextColor(views::Button::STATE_HOVERED,
520 notification.GetTextColor());
519 checkbox->SetChecked(notification.checked()); 521 checkbox->SetChecked(notification.checked());
520 checkbox->set_listener(this); 522 checkbox->set_listener(this);
521 view.reset(checkbox.release()); 523 view.reset(checkbox.release());
522 } else { 524 } else {
523 scoped_ptr<views::Label> label(new views::Label()); 525 scoped_ptr<views::Label> label(new views::Label());
524 label->SetText(notification.display_text()); 526 label->SetText(notification.display_text());
525 label->SetMultiLine(true); 527 label->SetMultiLine(true);
526 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 528 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
527 label->SetAutoColorReadabilityEnabled(false); 529 label->SetAutoColorReadabilityEnabled(false);
528 label->SetEnabledColor(notification.GetTextColor()); 530 label->SetEnabledColor(notification.GetTextColor());
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 1789 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
1788 : section(section), 1790 : section(section),
1789 container(NULL), 1791 container(NULL),
1790 manual_input(NULL), 1792 manual_input(NULL),
1791 suggested_info(NULL), 1793 suggested_info(NULL),
1792 suggested_button(NULL) {} 1794 suggested_button(NULL) {}
1793 1795
1794 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 1796 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
1795 1797
1796 } // namespace autofill 1798 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698