[Telemetry] Don't display "Locals:" header if there are no locals to print.

Doing the 'self' exclusion in the loop was too late.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238192 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238192
Add CanCloseDialog to WebDialogDelegate to allow blocking closing of dialog if needed.

There are some use cases that we don't allow user to close the web dialog until they have finish the UI flow and confirmed some important information. Currently, WebDialogDelegate can't control the closing of the dialog if user presses the "x" button on dialog title bar or presses Esc shortcut key. I am adding a CanClose() method to allow the subclass to block the dialog close if it needs to do so. 

BUG=322614

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238193 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238193