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..a0a86f8a95f7c94bc389fb188551a701226fc5a6 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 |
@@ -478,8 +479,11 @@ void AutofillDialogViews::OnDidChangeFocus( |
views::View* focused_now) {} |
void AutofillDialogViews::LinkClicked(views::Link* source, int event_flags) { |
+ DCHECK(source); // TODO(dbeam): needed? |
Ilya Sherman
2013/01/31 02:33:07
nit: Don't think this is needed, no.
Dan Beam
2013/01/31 02:48:51
Done.
|
+ |
// Sign in link. |
if (source == sign_in_link_) { |
+ DCHECK(signed_in_link_->enabled()); // TODO(dbeam): necessary? |
controller_->StartSignInFlow(); |
return; |
} |
@@ -568,12 +572,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_); |