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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 12094069: [autofill] Hook the sign-in button up to required actions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman@ review Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
index 138698cc6c52dba7667a47973306073eff77e728..c01e5c29e7a3f742dab19be50170749a04f8849e 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -290,6 +290,7 @@ AutofillDialogViews::~AutofillDialogViews() {
void AutofillDialogViews::Show() {
InitChildViews();
+ UpdateAccountChooser();
UpdateNotificationArea();
// Ownership of |contents_| is handed off by this call. The
@@ -480,6 +481,7 @@ void AutofillDialogViews::OnDidChangeFocus(
void AutofillDialogViews::LinkClicked(views::Link* source, int event_flags) {
// Sign in link.
if (source == sign_in_link_) {
+ DCHECK(sign_in_link_->enabled()); // TODO(dbeam): necessary?
controller_->StartSignInFlow();
return;
}
@@ -568,12 +570,20 @@ views::View* AutofillDialogViews::CreateNotificationArea() {
notification_label_->SetAutoColorReadabilityEnabled(false);
notification_label_->SetMultiLine(true);
notification_label_->set_collapse_when_hidden(true);
+ notification_label_->set_border(
+ views::Border::CreateEmptyBorder(10, 0, 10, 0));
notification_area->AddChildView(notification_label_);
return notification_area;
}
+void AutofillDialogViews::UpdateAccountChooser() {
+ sign_in_link_->SetEnabled(controller_->HasReceivedWalletResponse());
+ sign_in_link_->SetVisible(!controller_->HasReceivedWalletResponse() ||
+ !controller_->IsSignedIn());
+}
+
void AutofillDialogViews::UpdateNotificationArea() {
DCHECK(notification_label_);

Powered by Google App Engine
This is Rietveld 408576698