Settings: Fix two bugs on the password show/hide button.
commit759b8355d18868e49cfeeb8e342d157c31ecfd67
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 29 Oct 2013 18:35:21 +0000 (29 18:35 +0000)
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 29 Oct 2013 18:35:21 +0000 (29 18:35 +0000)
tree9d828db6ab9ef80ab6ea20059bed301a445c7c99
parentf59c047fc463ccb513c3bcbcf178ce3e93dd3866
Settings: Fix two bugs on the password show/hide button.

crbug.com/309593:
The button got focus by mousedown unexpectedly though we disabled it by
FocusManager.disableMouseFocusOnButtons because tryFocusOnAncestor() in list.js
gave focus on it. We avoid tryFocusOnAncestor() by adding
event.preventDefault().

crbug.com/308407:
Nothing was focused after showing a password.
 - PasswordManager::showPassword_ is called asynchronously after the button
   click, and it updates the list item model. It caused rebuild of the list item
   DOM nodes. We focus on the re-created INPUT element in
   PasswordListItem::showPassword().
 - Also, we need to call event.stopPropagation() for mousedown events of the
   button because we don't want to change focus by selection handling in List.

BUG=309593, 308407

Review URL: https://codereview.chromium.org/46043013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231603 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/resources/options/password_manager_list.js