HostTableEntry refactor
The HostTableEntry is currently shared between the local host section and
the host list. However, they have slightly different creation behavior.
For one, the DOM is generated on the fly for the HostList whereas the local
host section has its DOM hard coded in the ui_me2me.html.
In addition, the existing HostTableEntry expects the host to be passed in
during construction time. This is slightly awkward for the LocalHostSection
as the host is null until the local host has started.
After the refactoring, the HostTableEntry generates the DOM in its
constructor. The host is passed in via the setHost() function that updates
the DOM using querySelector and innerText. The refactor also combines
updateStatus() and setHostName() into once single function updateUI() that
refreshes the UI based on the underlying state (the host).
This CL also separates the local host section in the hostlist into its own class.
BUG=461539
Review URL: https://codereview.chromium.org/944183002
Cr-Commit-Position: refs/heads/master@{#319038}
diff --git a/remoting/remoting_webapp_files.gypi b/remoting/remoting_webapp_files.gypi
index f40df61..361b8ad 100644
--- a/remoting/remoting_webapp_files.gypi
+++ b/remoting/remoting_webapp_files.gypi
@@ -73,6 +73,7 @@
'webapp/unittests/dns_blackhole_checker_unittest.js',
'webapp/unittests/event_hook_unittest.js',
'webapp/unittests/fallback_signal_strategy_unittest.js',
+ 'webapp/unittests/host_table_entry_unittest.js',
'webapp/unittests/ipc_unittest.js',
'webapp/unittests/l10n_unittest.js',
'webapp/unittests/menu_button_unittest.js',
@@ -202,6 +203,7 @@
'webapp/crd/js/host_list_api.js',
'webapp/crd/js/host_list_api_impl.js',
'webapp/crd/js/host_table_entry.js',
+ 'webapp/crd/js/local_host_section.js',
],
# Logging and stats JavaScript files.
'remoting_webapp_js_logging_files': [