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

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: changes per review 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 // We have to do this instead of using set_border() because a border 506 // We have to do this instead of using set_border() because a border
507 // is being used to draw the check square. 507 // is being used to draw the check square.
508 static_cast<views::CheckboxNativeThemeBorder*>(checkbox->border())-> 508 static_cast<views::CheckboxNativeThemeBorder*>(checkbox->border())->
509 SetCustomInsets(gfx::Insets(kNotificationPadding, 509 SetCustomInsets(gfx::Insets(kNotificationPadding,
510 kNotificationPadding, 510 kNotificationPadding,
511 kNotificationPadding, 511 kNotificationPadding,
512 kNotificationPadding)); 512 kNotificationPadding));
513 if (!notification.interactive()) 513 if (!notification.interactive())
514 checkbox->SetState(views::Button::STATE_DISABLED); 514 checkbox->SetState(views::Button::STATE_DISABLED);
515 checkbox->SetText(notification.display_text()); 515 checkbox->SetText(notification.display_text());
516 checkbox->SetMultiLine(true); 516 checkbox->SetTextMultiLine(true);
517 checkbox->set_alignment(views::TextButtonBase::ALIGN_LEFT); 517 checkbox->SetHorizontalAlignment(gfx::ALIGN_LEFT);
518 checkbox->SetEnabledColor(notification.GetTextColor()); 518 checkbox->SetTextColor(views::Button::STATE_NORMAL,
519 checkbox->SetHoverColor(notification.GetTextColor()); 519 notification.GetTextColor());
520 checkbox->SetTextColor(views::Button::STATE_HOVERED,
521 notification.GetTextColor());
520 checkbox->SetChecked(notification.checked()); 522 checkbox->SetChecked(notification.checked());
521 checkbox->set_listener(this); 523 checkbox->set_listener(this);
522 view.reset(checkbox.release()); 524 view.reset(checkbox.release());
523 } else { 525 } else {
524 scoped_ptr<views::Label> label(new views::Label()); 526 scoped_ptr<views::Label> label(new views::Label());
525 label->SetText(notification.display_text()); 527 label->SetText(notification.display_text());
526 label->SetMultiLine(true); 528 label->SetMultiLine(true);
527 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 529 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
528 label->SetAutoColorReadabilityEnabled(false); 530 label->SetAutoColorReadabilityEnabled(false);
529 label->SetEnabledColor(notification.GetTextColor()); 531 label->SetEnabledColor(notification.GetTextColor());
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 1796 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
1795 : section(section), 1797 : section(section),
1796 container(NULL), 1798 container(NULL),
1797 manual_input(NULL), 1799 manual_input(NULL),
1798 suggested_info(NULL), 1800 suggested_info(NULL),
1799 suggested_button(NULL) {} 1801 suggested_button(NULL) {}
1800 1802
1801 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 1803 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
1802 1804
1803 } // namespace autofill 1805 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698