Handle selection changes due to AutoFill more carefully.

When previewing a form, select the contents of the initiating field so that typing will overwrite the field's contents.
When a form is filled, move the cursor to the end of the initiating field, so that typing appends text.
When a form is cleared, make sure that we restore the original value of the initiating field.

BUG=58774
TEST=browser_tests --gtest_filter=FormManagerTest.*Fill*:FormManagerTest.*Preview*

Review URL: http://codereview.chromium.org/4221002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64612 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed