app_list: Fix OpenSearchResult UAF

Move search_controller_->OpenResult() call to the last because
opening a result could be self destructing via ViewClosing if
the result opens a window. This was fine when ViewClosing is an
asynchronous mojo call. It is a problem now because the mojo call
is replaced with a synchronous C++ call.

Bug: 964762
Change-Id: Ia18a4ad0b08791321d1058b73ff4b4cf36027be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1618569
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661409}
2 files changed