| OLD | NEW |
| 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/location.h" | 10 #include "base/location.h" |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } | 500 } |
| 501 | 501 |
| 502 AutofillDialogViews::AccountChooser::~AccountChooser() {} | 502 AutofillDialogViews::AccountChooser::~AccountChooser() {} |
| 503 | 503 |
| 504 void AutofillDialogViews::AccountChooser::Update() { | 504 void AutofillDialogViews::AccountChooser::Update() { |
| 505 SetVisible(delegate_->ShouldShowAccountChooser()); | 505 SetVisible(delegate_->ShouldShowAccountChooser()); |
| 506 | 506 |
| 507 gfx::Image icon = delegate_->AccountChooserImage(); | 507 gfx::Image icon = delegate_->AccountChooserImage(); |
| 508 image_->SetImage(icon.AsImageSkia()); | 508 image_->SetImage(icon.AsImageSkia()); |
| 509 menu_button_->SetText(delegate_->AccountChooserText()); | 509 menu_button_->SetText(delegate_->AccountChooserText()); |
| 510 menu_button_->set_min_size(gfx::Size()); | 510 // This allows the button to shrink if the new text is smaller. |
| 511 menu_button_->ClearMaxTextSize(); |
| 511 | 512 |
| 512 bool show_link = !delegate_->MenuModelForAccountChooser(); | 513 bool show_link = !delegate_->MenuModelForAccountChooser(); |
| 513 menu_button_->SetVisible(!show_link); | 514 menu_button_->SetVisible(!show_link); |
| 514 link_->SetText(delegate_->SignInLinkText()); | 515 link_->SetText(delegate_->SignInLinkText()); |
| 515 link_->SetVisible(show_link); | 516 link_->SetVisible(show_link); |
| 516 | 517 |
| 517 menu_runner_.reset(); | 518 menu_runner_.reset(); |
| 518 | 519 |
| 519 PreferredSizeChanged(); | 520 PreferredSizeChanged(); |
| 520 } | 521 } |
| (...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2501 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2502 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
| 2502 : section(section), | 2503 : section(section), |
| 2503 container(NULL), | 2504 container(NULL), |
| 2504 manual_input(NULL), | 2505 manual_input(NULL), |
| 2505 suggested_info(NULL), | 2506 suggested_info(NULL), |
| 2506 suggested_button(NULL) {} | 2507 suggested_button(NULL) {} |
| 2507 | 2508 |
| 2508 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2509 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
| 2509 | 2510 |
| 2510 } // namespace autofill | 2511 } // namespace autofill |
| OLD | NEW |