diff options
Diffstat (limited to 'chrome/browser/views/password_manager_view.cc')
-rw-r--r-- | chrome/browser/views/password_manager_view.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/chrome/browser/views/password_manager_view.cc b/chrome/browser/views/password_manager_view.cc index eb7f5eb..a0561a3 100644 --- a/chrome/browser/views/password_manager_view.cc +++ b/chrome/browser/views/password_manager_view.cc @@ -26,9 +26,10 @@ static const int kDefaultWindowHeight = 240; //////////////////////////////////////////////////////////////////////////////// // MultiLabelButtons // -MultiLabelButtons::MultiLabelButtons(const std::wstring& label, +MultiLabelButtons::MultiLabelButtons(views::ButtonListener* listener, + const std::wstring& label, const std::wstring& alt_label) - : NativeButton(label), + : NativeButton(listener, label), label_(label), alt_label_(alt_label), pref_size_(-1, -1) { @@ -37,7 +38,7 @@ MultiLabelButtons::MultiLabelButtons(const std::wstring& label, gfx::Size MultiLabelButtons::GetPreferredSize() { if (pref_size_.width() == -1 && pref_size_.height() == -1) { // Let's compute our preferred size. - std::wstring current_label = GetLabel(); + std::wstring current_label = label(); SetLabel(label_); pref_size_ = NativeButton::GetPreferredSize(); SetLabel(alt_label_); @@ -204,11 +205,12 @@ void PasswordManagerView::Show(Profile* profile) { PasswordManagerView::PasswordManagerView(Profile* profile) : show_button_( + this, l10n_util::GetString(IDS_PASSWORD_MANAGER_VIEW_SHOW_BUTTON), l10n_util::GetString(IDS_PASSWORD_MANAGER_VIEW_HIDE_BUTTON)), - remove_button_(l10n_util::GetString( + remove_button_(this, l10n_util::GetString( IDS_PASSWORD_MANAGER_VIEW_REMOVE_BUTTON)), - remove_all_button_(l10n_util::GetString( + remove_all_button_(this, l10n_util::GetString( IDS_PASSWORD_MANAGER_VIEW_REMOVE_ALL_BUTTON)), table_model_(profile) { Init(); @@ -242,16 +244,13 @@ void PasswordManagerView::SetupButtonsAndLabels() { // Tell View not to delete class stack allocated views. show_button_.SetParentOwned(false); - show_button_.SetListener(this); show_button_.SetEnabled(false); remove_button_.SetParentOwned(false); - remove_button_.SetListener(this); remove_button_.SetEnabled(false); remove_all_button_.SetParentOwned(false); - remove_all_button_.SetListener(this); - + password_label_.SetParentOwned(false); } @@ -365,7 +364,7 @@ std::wstring PasswordManagerView::GetWindowTitle() const { return l10n_util::GetString(IDS_PASSWORD_MANAGER_VIEW_TITLE); } -void PasswordManagerView::ButtonPressed(views::NativeButton* sender) { +void PasswordManagerView::ButtonPressed(views::Button* sender) { DCHECK(window()); // Close will result in our destruction. if (sender == &remove_all_button_) { |