Commit 77bf3236 authored by Patrick Monette's avatar Patrick Monette Committed by Commit Bot

[3p-Conflicts] Fix a race condition in UninstallAppController.

It was possible to have repeated call to OnFocusChangedEvent() between
the time the name was written in the search box, and the actual destruction
of the automation controller, which unregisters the event handlers.

Bug: 819792
Change-Id: Ied95051f7ebb07e954b8c5d7d3cff0d3e7574daa
Reviewed-on: https://chromium-review.googlesource.com/955744
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542580}
parent 55a7b7bc
......@@ -194,6 +194,11 @@ void UninstallAppController::AutomationControllerDelegate::OnAutomationEvent(
void UninstallAppController::AutomationControllerDelegate::OnFocusChangedEvent(
IUIAutomation* automation,
IUIAutomationElement* sender) const {
// This callback can be null if the application name was already written in
// the search box and this instance is awaiting destruction.
if (!on_automation_finished_)
return;
base::string16 combo_box_id(
GetCachedBstrValue(sender, UIA_AutomationIdPropertyId));
if (combo_box_id != L"SystemSettings_AppsFeatures_AppControl_ComboBox")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment