review: Refactor to reuse same code as PublishComments web UI

This way the two interfaces to the same action have the same
behavior, and stay in sync with each other if any changes are
made in the future.

Change-Id: Iad6bedbc445fbd102a53e593787b32ce9bc3942e
1 file changed