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

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: rm dcheck 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15 matching lines...) Expand all
26 #include "ui/base/l10n/l10n_util.h" 26 #include "ui/base/l10n/l10n_util.h"
27 #include "ui/base/models/combobox_model.h" 27 #include "ui/base/models/combobox_model.h"
28 #include "ui/base/models/menu_model.h" 28 #include "ui/base/models/menu_model.h"
29 #include "ui/base/resource/resource_bundle.h" 29 #include "ui/base/resource/resource_bundle.h"
30 #include "ui/gfx/canvas.h" 30 #include "ui/gfx/canvas.h"
31 #include "ui/views/background.h" 31 #include "ui/views/background.h"
32 #include "ui/views/border.h" 32 #include "ui/views/border.h"
33 #include "ui/views/controls/button/checkbox.h" 33 #include "ui/views/controls/button/checkbox.h"
34 #include "ui/views/controls/button/image_button.h" 34 #include "ui/views/controls/button/image_button.h"
35 #include "ui/views/controls/button/label_button.h" 35 #include "ui/views/controls/button/label_button.h"
36 #include "ui/views/controls/button/label_button_border.h"
36 #include "ui/views/controls/combobox/combobox.h" 37 #include "ui/views/controls/combobox/combobox.h"
37 #include "ui/views/controls/image_view.h" 38 #include "ui/views/controls/image_view.h"
38 #include "ui/views/controls/label.h" 39 #include "ui/views/controls/label.h"
39 #include "ui/views/controls/link.h" 40 #include "ui/views/controls/link.h"
40 #include "ui/views/controls/menu/menu_runner.h" 41 #include "ui/views/controls/menu/menu_runner.h"
41 #include "ui/views/controls/separator.h" 42 #include "ui/views/controls/separator.h"
42 #include "ui/views/controls/styled_label.h" 43 #include "ui/views/controls/styled_label.h"
43 #include "ui/views/controls/textfield/textfield.h" 44 #include "ui/views/controls/textfield/textfield.h"
44 #include "ui/views/controls/webview/webview.h" 45 #include "ui/views/controls/webview/webview.h"
45 #include "ui/views/layout/box_layout.h" 46 #include "ui/views/layout/box_layout.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 499
499 for (size_t i = 0; i < notifications_.size(); ++i) { 500 for (size_t i = 0; i < notifications_.size(); ++i) {
500 const DialogNotification& notification = notifications_[i]; 501 const DialogNotification& notification = notifications_[i];
501 502
502 scoped_ptr<views::View> view; 503 scoped_ptr<views::View> view;
503 if (notification.HasCheckbox()) { 504 if (notification.HasCheckbox()) {
504 scoped_ptr<views::Checkbox> checkbox(new views::Checkbox(string16())); 505 scoped_ptr<views::Checkbox> checkbox(new views::Checkbox(string16()));
505 checkbox_ = checkbox.get(); 506 checkbox_ = checkbox.get();
506 // We have to do this instead of using set_border() because a border 507 // We have to do this instead of using set_border() because a border
507 // is being used to draw the check square. 508 // is being used to draw the check square.
508 static_cast<views::CheckboxNativeThemeBorder*>(checkbox->border())-> 509 static_cast<views::LabelButtonBorder*>(checkbox->border())->
509 SetCustomInsets(gfx::Insets(kNotificationPadding, 510 set_insets(gfx::Insets(kNotificationPadding,
510 kNotificationPadding, 511 kNotificationPadding,
511 kNotificationPadding, 512 kNotificationPadding,
512 kNotificationPadding)); 513 kNotificationPadding));
513 if (!notification.interactive()) 514 if (!notification.interactive())
514 checkbox->SetState(views::Button::STATE_DISABLED); 515 checkbox->SetState(views::Button::STATE_DISABLED);
515 checkbox->SetText(notification.display_text()); 516 checkbox->SetText(notification.display_text());
516 checkbox->SetMultiLine(true); 517 checkbox->SetTextMultiLine(true);
517 checkbox->set_alignment(views::TextButtonBase::ALIGN_LEFT); 518 checkbox->SetHorizontalAlignment(gfx::ALIGN_LEFT);
518 checkbox->SetEnabledColor(notification.GetTextColor()); 519 checkbox->SetTextColor(views::Button::STATE_NORMAL,
519 checkbox->SetHoverColor(notification.GetTextColor()); 520 notification.GetTextColor());
521 checkbox->SetTextColor(views::Button::STATE_HOVERED,
522 notification.GetTextColor());
520 checkbox->SetChecked(notification.checked()); 523 checkbox->SetChecked(notification.checked());
521 checkbox->set_listener(this); 524 checkbox->set_listener(this);
522 view.reset(checkbox.release()); 525 view.reset(checkbox.release());
523 } else { 526 } else {
524 scoped_ptr<views::Label> label(new views::Label()); 527 scoped_ptr<views::Label> label(new views::Label());
525 label->SetText(notification.display_text()); 528 label->SetText(notification.display_text());
526 label->SetMultiLine(true); 529 label->SetMultiLine(true);
527 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 530 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
528 label->SetAutoColorReadabilityEnabled(false); 531 label->SetAutoColorReadabilityEnabled(false);
529 label->SetEnabledColor(notification.GetTextColor()); 532 label->SetEnabledColor(notification.GetTextColor());
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 1819 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
1817 : section(section), 1820 : section(section),
1818 container(NULL), 1821 container(NULL),
1819 manual_input(NULL), 1822 manual_input(NULL),
1820 suggested_info(NULL), 1823 suggested_info(NULL),
1821 suggested_button(NULL) {} 1824 suggested_button(NULL) {}
1822 1825
1823 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 1826 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
1824 1827
1825 } // namespace autofill 1828 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698