[CrOS Network] Fix issue which connected to network during configure.

When users click the "Configure" button in settings, a network
configuration dialog pops up. If a user fills in a password and presses
Enter, the device would attempt to connect to the network rather than
simply configuring the network.

This issue was caused by the fact that the <network-config> intercepted
the "Enter" event and immediately tried to connect, even if the dialog
was in "configure" mode instead of "connect" mode.

This CL changes logic such that when the "Enter" key is pressed,
<network-config> fires an event which is handled by its parent element;
then, the parent element decides whether to connect or to configure.

Bug: 974737
Change-Id: Ib2b89636451809c436f3ef4e996affa0cd065bf1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671852
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671781}
4 files changed