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:

----- https://crrev.com/c/1428939
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
Reviewed-on: https://chromium-review.googlesource.com/c/1428939
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626208}(cherry picked from commit ceb5964755062a1972ad1f7c12b5aff134ce71bf)

----- https://crrev.com/c/1437703
Add includes for IWYU: follow-on for cl/1428939

This CL just adds some includes that were harmlessly forgotten
on https://crrev.com/c/1428939 .

Change-Id: Ic885065cbf20398dfff723a85aff35141e0cb9a5
Reviewed-on: https://chromium-review.googlesource.com/c/1444696
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#77}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
2 files changed