Commit 82df23f9 authored by dubroy@chromium.org's avatar dubroy@chromium.org

Reland 270975: [Mac] Unselect generated password when mouse leaves password bounds.

> Revert of [Mac] Unselect generated password when mouse leaves password bounds. (https://codereview.chromium.org/282093006/)
> 
> Reason for revert:
> Speculative revert, FormFillLatencyAfterSubmit is failing
> 
> Original issue's description:
> > [Mac] Unselect generated password when mouse leaves password bounds.
> > 
> > In the Mac implementation of the password generation poup, the password
> > row is not unselected when the mouse is moved elsewhere in the popup
> > (e.g. over top of the help text).
> > 
> > The fix is that PasswordSelected() should always be called in
> > SetSelectionAtPoint, not just when the mouse is within the password
> > bounds. The Views implementation happens to work because it has a
> > subview (PasswordRow) which triggers OnMouseExited() when the mouse
> > moves outside of the password bounds.
> > 
> > Also added an optimization that PasswordSelectionUpdated() is only
> > called when the value is actually changed, not every time
> > PasswordSelected() is called.
> > 
> > BUG=114092
> > R=isherman@chromium.org
> > 
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=270975
> 
> TBR=gcasto@chromium.org,isherman@chromium.org,dubroy@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=114092
> 
> Review URL: https://codereview.chromium.org/287063007

TBR=akuegel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271364 0039d316-1c4b-4281-b951-d872f2087c98
parent d15f5fa5
......@@ -137,7 +137,7 @@ bool PasswordGenerationPopupControllerImpl::PossiblyAcceptPassword() {
}
void PasswordGenerationPopupControllerImpl::PasswordSelected(bool selected) {
if (!display_password_)
if (!display_password_ || selected == password_selected_)
return;
password_selected_ = selected;
......@@ -289,8 +289,7 @@ void PasswordGenerationPopupControllerImpl::OnSavedPasswordsLinkClicked() {
void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint(
const gfx::Point& point) {
if (password_bounds_.Contains(point))
PasswordSelected(true);
PasswordSelected(password_bounds_.Contains(point));
}
bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment