Track Dynamically Assigned Command IDs in Background Menu Generation

Menu items require that Command IDs be unique. For a single profile,
collisions don't happen. For multiple profiles, the profile menu
as well as its submenus start at Command ID 0, confusing the menu
system when it tries to identify or change and item.

The fix here creates an vector to hold the extension indexes
using the vector index as a Command ID. For profile menu labels,
the extension index is -1.

As a bonus, we now clean up the background submenus when multiple profiles exist. Previously, the submenus were leaking away.

BUG=315164

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236489

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

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