Preserve vector order in RemoveDuplicatePrepopulateIDs

This CL is the union of 2 other CLs. The purpose of this CL is
to ensure one clean merge to the M73 branch. The 2 source CLs are:

Preserve vector order in RemoveDuplicatePrepopulateIDs

Template URLs with nonzero prepopulate_id were implicitly
reordered by RemoveDuplicatePrepopulateIDs, though relative
order was preserved for elements with zero prepopulate_id.
This CL adjusts the algorithm to output the selected
representatives for each prepopulate_id in order of first
appearance in the original template_urls vector, stabilizing
the overall order (instead of partitioning as it did before).

Bug: 924268
Change-Id: Ic885065cbf20398dfff723a85aff35141e0cb9a5
Commit-Queue: Orin Jaworski <>
Reviewed-by: Vasilii Sukhanov <>
Cr-Commit-Position: refs/heads/master@{#626208}(cherry picked from commit ceb5964755062a1972ad1f7c12b5aff134ce71bf)

Add includes for IWYU: follow-on for cl/1428939

This CL just adds some includes that were harmlessly forgotten
on .

Change-Id: Ic885065cbf20398dfff723a85aff35141e0cb9a5
Reviewed-by: Justin Donnelly <>
Cr-Commit-Position: refs/branch-heads/3683@{#77}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
2 files changed