diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-22 18:07:29 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-22 18:07:29 +0000 |
commit | 63329059634643cb573b323aa03b9fdeda555bd4 (patch) | |
tree | 2bf3718d783fbd3c26582eb1e568f33107b513b1 /chrome/browser/views | |
parent | 9e14636ebaef5313ccc4f6c3f1b185cb623dd0ba (diff) | |
download | chromium_src-63329059634643cb573b323aa03b9fdeda555bd4.zip chromium_src-63329059634643cb573b323aa03b9fdeda555bd4.tar.gz chromium_src-63329059634643cb573b323aa03b9fdeda555bd4.tar.bz2 |
Landing Thiago Farina bug fix for the saved password dialog.
See http://codereview.chromium.org/125239
BUG=7863
TEST=See bug
TBR=ben
Review URL: http://codereview.chromium.org/142001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/options/passwords_page_view.cc | 23 | ||||
-rw-r--r-- | chrome/browser/views/options/passwords_page_view.h | 1 |
2 files changed, 18 insertions, 6 deletions
diff --git a/chrome/browser/views/options/passwords_page_view.cc b/chrome/browser/views/options/passwords_page_view.cc index e7337cb..2517d6d 100644 --- a/chrome/browser/views/options/passwords_page_view.cc +++ b/chrome/browser/views/options/passwords_page_view.cc @@ -193,17 +193,28 @@ PasswordsPageView::PasswordsPageView(Profile* profile) this, l10n_util::GetString(IDS_PASSWORDS_PAGE_VIEW_REMOVE_ALL_BUTTON))), table_model_(profile), - table_view_(NULL) { + table_view_(NULL), + current_selected_password_(NULL) { } void PasswordsPageView::OnSelectionChanged() { bool has_selection = table_view_->SelectedRowCount() > 0; remove_button_.SetEnabled(has_selection); - // Reset the password related views. - show_button_.SetLabel( - l10n_util::GetString(IDS_PASSWORDS_PAGE_VIEW_SHOW_BUTTON)); - show_button_.SetEnabled(has_selection); - password_label_.SetText(std::wstring()); + + views::TableSelectionIterator iter = table_view_->SelectionBegin(); + int row = *iter; + PasswordForm* selected = table_model_.GetPasswordFormAt(row); + DCHECK(++iter == table_view_->SelectionEnd()); + + if (selected != current_selected_password_) { + // Reset the password related views. + show_button_.SetLabel( + l10n_util::GetString(IDS_PASSWORDS_PAGE_VIEW_SHOW_BUTTON)); + show_button_.SetEnabled(has_selection); + password_label_.SetText(std::wstring()); + + current_selected_password_ = selected; + } } void PasswordsPageView::ButtonPressed(views::Button* sender) { diff --git a/chrome/browser/views/options/passwords_page_view.h b/chrome/browser/views/options/passwords_page_view.h index 7238f4c..fb736ca 100644 --- a/chrome/browser/views/options/passwords_page_view.h +++ b/chrome/browser/views/options/passwords_page_view.h @@ -175,6 +175,7 @@ class PasswordsPageView : public OptionsPageView, views::NativeButton remove_button_; views::NativeButton remove_all_button_; views::Label password_label_; + webkit_glue::PasswordForm* current_selected_password_; DISALLOW_COPY_AND_ASSIGN(PasswordsPageView); }; |